get directory name of file being executed
Bernhard Herzog
bh at intevation.de
Thu Feb 27 12:28:08 EST 2003
More information about the Python-list mailing list
Thu Feb 27 12:28:08 EST 2003
- Previous message (by thread): get directory name of file being executed
- Next message (by thread): get directory name of file being executed
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Skip Montanaro <skip at pobox.com> writes: > David> I'm doing this: > > David> /usr/bin/python2 /some/script/in/a/dir/foo.py > > David> I want to get "/some/script/in/a/dir/", not the cwd of where I > David> launched the script from. [...] > > Inside foo.py you have a global variable __file__. Not with Python 2.2.x, unfortunately. This will work with 2.3, though. Bernhard -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ MapIt! http://www.mapit.de/
- Previous message (by thread): get directory name of file being executed
- Next message (by thread): get directory name of file being executed
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list