[Q] Python and Path

Maan Hamze MHAMZE at austin.rr.com
Sun Aug 19 08:48:16 CEST 2001


You can either append the path to sys.path:
import sys
sys.path.append (PathOfCode)

Or, if you do not want to deal with appending this to sys.path, check your
environment for PYTHONWIN setting and create it if it is not there.  Then
add the path to this setting:
In Win NT:  right click on My Computer and check Environment tab.  If
PYTHONWIN is not there, create it and set path there.  If setting is there,
add path to it.
In WIN ME:  run msconfig, and add setting through Environment tab.
In Win 95/98/98SE:  In autoexec.bat add:
SET PYTHONWIN = Paths to libs
Maan

"Young-Jin Lee" <ylee12 at uiuc.edu> wrote in message
news:Slff7.6824$A3.50199 at vixen.cso.uiuc.edu...
> Hi, I have a question on Python and path.
> How can I tell Python to search a python source file in a specify
directory?
> I created a python test code in my working directory and I lauchched the
> Python interpreter from the desktop shortcut. I need to be able to specify
> the path (similar to Java's classpath), but I don't know how.
> Thanks in advance.
>
> YL
>
>





More information about the Python-list mailing list