Empty sys.path[0]

Nick Perkins nperkins7 at home.com
Mon Jul 9 08:24:46 CEST 2001

"Gustaf Liljegren" <gustafl at algonet.se> wrote in message
news:Xns90D9116ADA12Bgustaflalgonetse at

.... when I run it with only the filename:
> E:\test>python syspath.py
> Nothing! ...

hmm, strange..
In those cases, the os.getcwd should give you the right answer.
you could start scripts with:

import sys
if not sys.path[0]:
    import os

More information about the Python-list mailing list