get script path

hg hg at nospam.org
Mon Dec 4 06:50:22 EST 2006


Hi,

must I parse argv[0] to get it, or is there an easier way (that works under
Windows and *nix)?

Ex:

python /home/hg/test/test.py ==> test.py #knows it is in /home/hg/test

Thanks,

hg






More information about the Python-list mailing list