sys.argv[0] - Returns path and filename.

Mark McEahern marklists at mceahern.com
Thu Jun 27 09:00:12 EDT 2002


> How do I get the current path of the script I am running, on the mac
> osx and the linux box ? (Any work around would be great, I don't want
> to have to hardcode the path into the script, or even give the path as
> an argument,I want the script to know where it is.)

import os
print os.getcwd()

// m
-






More information about the Python-list mailing list