[Tutor] PYTHONPATH: where to set on Win9x

Israel Evans israel@lith.com
Wed, 13 Jun 2001 14:48:02 -0700


I find that I get goofy behavior in Win200 when I set PYTHONPATH to have
more than one directory in it.  As soon as I add a second dir, Idle stops
working.  

-----Original Message-----
From: D-Man [mailto:dsh8290@rit.edu]
Sent: Wednesday, June 13, 2001 2:20 PM
To: tutor@python.org
Subject: Re: [Tutor] PYTHONPATH: where to set on Win9x


On Wed, Jun 13, 2001 at 10:45:11PM +0200, Christian Mascher wrote:
| So I guess I only have to use PYTHONPATH for having my personal
| directories turn up in sys.path, is that right? Meaning I only need
| to put set PYTHONPATH=d:\mypython in autoexec.bat to include that
| directory. It works, but is it "the right way" or did I miss a
| point?

You got it.  Python knows where to find the standard stuff, you just
have to add your stuff.

| By the way, is the global autoexec.bat really the best place for putting
| this? 

It is a convenient place, especially if you never change it.

| Normally, when I use a console-started compiler (like javac for
| instance), I have an extra .bat-script setting the appropriate
| environment-variables only when opening the shell (DOS-box)
| dedicated to Java or whatever. So it is possible to add environment
| variables later.  Could/should this be done for the python shell as
| well? 

If you prefer you can use a series of scripts just like with java.
The main issue you would run into there is if .py files are associated
with python.exe, not your own .bat file.  Then they would run
python.exe directly and not get your environment changes.

I use Linux or cygwin on Windows so I simply put stuff in ~/.bashrc,
or I make separate scripts if I need to switch stuff around (such as
using a DOS path for $VIM for win32 gvim, and a POSIX path for
cygwin's console-vim).  I always have one or more console (bash)
windows open where I run things from anyways.

HTH,
-D


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