os.path.dirname(sys.argv[0]) always returns nothing

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Aug 1 19:57:11 EDT 2011


Thijs Engels wrote:

> argv[0] returns the name of the current file (string), but no path
> information if I recall correct.

It's the path that was used to specify the script by whatever
launched it, so it could be either absolute or relative to
the current directory.

-- 
Greg



More information about the Python-list mailing list