import question

Larry Bates lbates at swamisoft.com
Tue May 11 10:22:14 EDT 2004


I do this by putting what you refer to as "staging"
on separate logical drive (windows) or with a symlink
(linux) and placing the root in my pythonpath environment.
Then I don't have to change my code, just the pythonpath.

HTH,
Larry Bates
Syscon, Inc.

"Ksenia Marasanova" <ksenia at ksenia.nl> wrote in message
news:mailman.374.1084112165.25742.python-list at python.org...
> 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.
>
>
>





More information about the Python-list mailing list