sys.argv[0] doesn't always contain the full path of running script.
Miki
miki.tebeka at gmail.com
Tue Aug 29 14:39:30 EDT 2006
Hello Max,
> How can I find where exactly the current python script is running?
> ...
> That means sys.argv[0] doesn't always contain the full path of
> running script.
sys.path[0] is the script directory, combined with sys.argv[0] you can
find the full path to the script.
(Note that in some rare cases sys.path[0] might not contain the script
directory. For example in an executable created by py2exe).
HTH.
--
Miki
http://pythonwise.blogspot.com
More information about the Python-list
mailing list