I would like to know if there is any way to be able to use the modules of a project, regardless of the module's path, if it is in one or more directories above the current script
since what I have tried to do is something like this but it doesn't work.
import os
r = os.path.realpath(file.py)
from r import functionR
When I investigated a little more, I found something that talks about adding the modules to the main path, but I don't know if that is correct?
I hope you can help me a little
added an example route i'm using
root
folder1
folder11
file1.py
folder2
folder22
file2.py
file_one.py
For example, try using the file_one.py module in files that are at lower levels, for example file1.py or file2.py
I hope you can help me