sys.path[0] in IDLE
Gabriel Genellina
gagenellina at softlab.com.ar
Fri Dec 26 21:49:55 EST 2003
At 26/12/2003 22:25, you wrote:
>Am I reading this correctly?
>
>http://python.org/doc/current/lib/module-sys.html
>
>"""
>As initialized upon program startup, the first item of this list,
>path[0], is the directory containing the script that was used to
>invoke the Python interpreter.
>"""
>
>
>So, sys.path[0] should be the directory that my script is in?
>
>Even if running the script from IDLE?
>
>Has anyone else had problems with this? Especially on windows?
(Read the remaining of the paragraph too)
When using IDLE, the "script" is really idle.py. If you start IDLE with
another script as an argument, its dir is prepended in sys.path
Gabriel Genellina
Softlab SRL
More information about the Python-list
mailing list