get directory name of file being executed

David N. Welton davidw at
Thu Feb 27 06:56:10 CET 2003

In Tcl, you do this with 'info script'.

I'm doing this:

/usr/bin/python2 /some/script/in/a/dir/

I want to get "/some/script/in/a/dir/", not the cwd of where I
launched the script from.

Is that possible?

David N. Welton
Free Software:
   Apache Tcl:

More information about the Python-list mailing list