get directory name of file being executed

David N. Welton davidw at dedasys.com
Thu Feb 27 00:56:10 EST 2003


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

I'm doing this:

/usr/bin/python2 /some/script/in/a/dir/foo.py

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

Is that possible?

Thankyou,
-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/




More information about the Python-list mailing list