K
Ksenia Marasanova
Hi list,
I'd appreciate any advice on the following:
In the "live" environment, I have some Python scripts which make use of
Python packages. The directory structure is something like that:
/live/
/live/py/
/live/lib/
There is a .pth file in the Python site-packages directory, which
contains "/live/lib".
In the scripts, packages are imported with a normal import statement,
like this:
from module.submodule import someclass
Nothing unusual.
Now I want to use the same server for "staging" environment. The
additional directory structure will be:
/staging/
/staging/py/
/staging/lib/
After testing, files will be copied from "staging" to "live".
Now my question: what would be the proper way to construct the import
statement, so no modifications will be needed when copying files? I
first thought about relative import (from ..lib import something) , but
it seems not (yet) to be an option
Appreciate any tips!
Thanx,
Ksenia.
I'd appreciate any advice on the following:
In the "live" environment, I have some Python scripts which make use of
Python packages. The directory structure is something like that:
/live/
/live/py/
/live/lib/
There is a .pth file in the Python site-packages directory, which
contains "/live/lib".
In the scripts, packages are imported with a normal import statement,
like this:
from module.submodule import someclass
Nothing unusual.
Now I want to use the same server for "staging" environment. The
additional directory structure will be:
/staging/
/staging/py/
/staging/lib/
After testing, files will be copied from "staging" to "live".
Now my question: what would be the proper way to construct the import
statement, so no modifications will be needed when copying files? I
first thought about relative import (from ..lib import something) , but
it seems not (yet) to be an option
Appreciate any tips!
Thanx,
Ksenia.