Empty sys.path[0]

Gustaf Liljegren gustafl at algonet.se
Sat Jul 7 11:52:04 EDT 2001


Michal Wallace <sabren at manifestation.com> wrote:

>Where do the docs say this? It sounds like a mistake, or something
>that needs clarification..

In the library reference, for the 'path' list in the 'os' module: "The 
first item of this list, path[0], is the directory containing the script 
that was used to invoke the Python interpreter." I interpreted it as the 
directory with the script.

>you want os.getcwd()

It says it returns the working directory. Is that always where the script 
file is? Suppose I call the script from another directory?

Regards,

Gustaf Liljegren



More information about the Python-list mailing list