[Python-Dev] PythonCore\CurrentVersion
Guido van Rossum
guido at python.org
Tue Oct 11 17:19:00 CEST 2005
On 10/11/05, Tim Peters <tim.peters at gmail.com> wrote:
> Well, that's in interactive mode, and I see sys.path[0] == "" on both
> Windows and Linux then. I don't see "" in sys.path on either box in
> batch mode, although I do see the absolutized path to the current
> directory in sys.path in batch mode on Windows but not on Linux -- but
> Mark Hammond says he doesn't see (any form of) the current directory
> in sys.path in batch mode on Windows.
>
> It's a bit confusing ;-)
How did you test batch mode?
All:
sys.path[0] is *not* defined to be the current directory.
It is defined to be the directory of the script that was used to
invoke python (sys.argv[0], typically). If there is no script, or it
is being read from stdin, the default is ''.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list