How to get path of a .py script
P_spam_ at draigBrady.com
P_spam_ at draigBrady.com
Wed Dec 11 07:19:25 EST 2002
More information about the Python-list mailing list
Wed Dec 11 07:19:25 EST 2002
- Previous message (by thread): How to get path of a .py script
- Next message (by thread): How to get path of a .py script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Devrim Erdem wrote: > Hi, > > On linux I have a script runSomething.py, the script is sometimes > executed from a link on the desktop or from another dir. > > How can I get the path of the script file itself so that I can locate > files which are relative to the script file ? How about: os.dirname(os.path.realpath(sys.argv[0]))+"/myfile" Pádraig.
- Previous message (by thread): How to get path of a .py script
- Next message (by thread): How to get path of a .py script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list