Search path for python script

Peter Otten __peter__ at web.de
Thu Sep 13 02:19:09 EDT 2007


Am Wed, 12 Sep 2007 14:40:30 -0700 schrieb grt:

> I'm new to python, running it under cygwin. This must be easy but I
> haven't figured it out. I'm trying to run a script by typing:
> 
> python test.py
> 
> where test.py is in a directory I've added to PYTHONPATH, but test.py
> is not found. Perhaps PYTHONPATH only applies to modules imported
> within a script. I didn't notice an option to python to search the
> standard path, like Perl -S.
> 
> How is this done?

python -m test

Peter



More information about the Python-list mailing list