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 > session.
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: export PYTHONPATH="/path/to/my/modules" 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:pet...@petard.us > http://www.petard.us > http://www.petard.us/blog > http://www.petard.us/gallery > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- Steve Willoughby | Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor