IDLE module path problem

Gregory William Bair gbair at
Sun Oct 20 17:18:38 CEST 2002

GerritM <gmuller at> spewed:
> "papua" <a at> schreef in bericht
> news:MPG.181be1164d06a0a5989680 at
>> I have a python script / that starts with
>> from xxx import *
>> where / is a file in the same directory as / When I start
>> this program from the MS Windows console, it runs but when I start it
>> from IDLE then / is not found. What should I do?
>> --
>> TIA,
>> Janos Blazi

> One way to make sure that the interpreter finds modules in its path is by
> providing .pth files in the Python main directory. In this file you put a
> single text line with the path name:
> C:/dirname/moduledir
> All pathes in pth files are added to the Python path and will be found
> irrespective of the current working directory.

> regards Gerrit

I don't use Python on my windows machine, but I know that a lot of IDEs run programs (or
scripts in this case) in either the IDE's directory or a temp directory, so your script is
all by itself.  Take the above poster's suggestion.  

I do have a question about the pth files.  When you say they are added to the Python path,
is that only effective after reboot?  Also, what is the UNIX equiv of pth files?  Just
some random questions from an inquisitive mind.

IUPUI School of Informatics

More information about the Python-list mailing list