sys.path and os.chdir

James Kew james.kew at
Wed Aug 21 20:28:09 CEST 2002

"Anton Vredegoor" <anton at> wrote in message
news:ak855u$n5l$1 at
> On 23 Aug 2002 06:22:59 -0700, Ugo_DiGirolamo at (ugodiggi)

> However, the unofficial interpretation of sys.path[0] is that it is the
> directory the script is started from. sounds quite official
about this to me:

"The first item of this list, path[0], is the directory containing the
script that was used to invoke the Python interpreter. If the script
directory is not available (e.g. if the interpreter is invoked interactively
or if the script is read from standard input), path[0] is the empty string,
which directs Python to search modules in the current directory first."


More information about the Python-list mailing list