Feed on

to get the full pathname to a script that python is executing, use the handy little one-liner:

>> os.path.abspath(sys.argv[0])

Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

One Response to “get full location of currently executing python script”

  1. on 07 Jun 2009 at 1:39 am kym watts

    Thanks, thats exactly what i have been looking for.

Did I get this wrong? Let me know!

Trackback URI | Comments RSS