steve at alchemy.com
Tue Jun 30 21:08:13 CEST 2009
On Tue, Jun 30, 2009 at 02:33:27PM -0400, Bob Rea wrote:
> In working my way through the book on python, I am working
> in directories for chapers. Now I am on modules, and some
> are reused in later chapters. I have set up a directory for
> the modules. How do I add it to my PYTHONPATH?
> I can use sys.path.append but that only lasts for the
You set the variable in your system's environment, which is
platform-dependent. For Linux, you'd typically put a line
in your ~/.profile or ~/.cshrc or ~/.login or ~/.bashrc or
whatever your shell uses per your account set up.
So, for example, in a bash/sh shell, you'd say:
or for csh:
setenv PYTHONPATH "/path/to/my/modules"
Then starting the next time you log in, that will be set
in your environment for you.
> This is on a suse linux 10 box
> Bob Rea
> mailto:petard at petard.us
> Tutor maillist - Tutor at python.org
Steve Willoughby | Using billion-dollar satellites
steve at alchemy.com | to hunt for Tupperware.
More information about the Tutor