Re: [Tutor] PYTHONPATH-corrected

2009-07-01 Thread Alan Gauld


"Steve Willoughby"  wrote


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?



So, for example, in a bash/sh shell, you'd say:

export PYTHONPATH="/path/to/my/modules"


And you can add multiple directories by separating them with colons:

export 
PYTHONPATH="/path/to/my/modules:/path/to/more/modules:/path/ytoyet/more"


HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] PYTHONPATH-corrected

2009-06-30 Thread Steve Willoughby
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


[Tutor] PYTHONPATH-corrected

2009-06-30 Thread Bob Rea
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.

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