Newbie Q: PYTHONPATH_1 vs PYTHONPATH_2?

Harry George hgg9140 at seanet.com
Sat Jul 28 13:04:03 CEST 2001


engsol at teleport.com writes:

> I have an "old" copy of Python on my NT machine. I've tailored
> PYTHONPATH to know about myfiles and mylib, etc.
> 
> But I've now installed Python 2.1.1 in a different directory, and
> would like to create PYTHONPATH_2, so as to not have to expand the
> vanilla PYTHONPATH forever as new versions are available.
> 
> Is this do-able?
>

For each version of python, make a script.  E.g., for
running python 2.0:

/usr/local/bin/py20:
    #!/bin/sh
    export PYTHONHOME=/usr/local
    export PYTHONPATH=/usr/local/lib/python2.0: (no line break)
            /usr/local/lib/python2.0/site-packages
    /usr/local/bin/python2.0 $@

Then you can run interactive or batch by using py152,py20, py21, etc. 

> Thanks....engsol

-- 
Harry George
hgg9140 at seanet.com



More information about the Python-list mailing list