[Tutor] folder and module

linda.s samrobertsmith at gmail.com
Sun Sep 17 12:43:25 CEST 2006


> > i have test.py under c:\try1\new;
> > I want to import b and b.py is under c:\trytry. How to do it?
> > Also, I import c and c.py is in the desktop folder but no error
> > reported.
>
> Python imports modules by looking for them in the folders
> listed in the variable sys.path. sys.path gets populated when
> Python starts up and includes some standard locations plus
> any you define in your PYTHONPATH environment variable.
>
I checked my PYTHONPATH environment variable (both user variables and
system variables) but I only see a directory (which is a downloaded
python library's directory listed under PYTHONPATH in user variables .
My questions are:
1. since the desktop directory is not listed in the PYTHONPATH ,
why there is no error report when I import a module which is in the desktop?
2. why there is no directory such as c:\python24 where I install the python?
Thanks,
Linda


More information about the Tutor mailing list