Jul-31-2024, 09:08 AM
Hi
It's a naive question to find the correct synthax (all i tested failed):
Context: In
If all files are located in the current directory (traditional situation):
Thanks
It's a naive question to find the correct synthax (all i tested failed):
Context: In
MyFile1.py
, i want to load the function1 and function2.If all files are located in the current directory (traditional situation):
from MyFile1 import function1, function2Now i move-up "MyFile1.py" into the upper directory:
from ..MyFile1 import function1, function2
Error:ImportError: attempted relative import with no known parent package
Same error if i create a module:MyModule.py
from MyFile1 import function1, function2Then I call the module
from ..MyModule import function1, function2What I'm missing (it supposed to be quite simple)?
Thanks