Empty sys.path[0]

Gustaf Liljegren gustafl at algonet.se
Sun Jul 8 19:42:11 EDT 2001


Peter Hansen <peter at engcorp.com> wrote:

>I think you mean the "sys" module above, not the "os" module.

Yes, sorry.

>and you run it from another directory (e.g. 'python c:\windows\test.py'
>or 'python /tmp/test.py' what do you get?

I made this script:

import sys
print sys.path[0]

And here I run it from another directory:

E:\>python e:\test\syspath.py
e:\test

That works. Now I run it from the same directory, but still with the full 
path:

E:\test>python e:\test\syspath.py
e:\test

That works too, but look here when I run it with only the filename:

E:\test>python syspath.py


Nothing! This is the problem I have. It think the second and third case 
ought to mean the same.

Regards,

Gustaf Liljegren



More information about the Python-list mailing list