Name of the Script

Alex Martelli aleaxit at yahoo.com
Mon Mar 5 14:54:08 EST 2001


"David Given" <dg at pearl.tao.co.uk> wrote in message
news:u0i089.7it.ln at 127.0.0.1...
    [snip]
> in argv[0]. (This is the same as a the generic Unix question: `How do I
> find out where my executable lives?' It's basically not solveable.) I
> don't know about Windows, though.

In Windows, location of the executable and/or dll IS solvable (there's
a system-call, or API if you will, expressly for that), but you still would
not learn 'exactly how' it was invoked (through ShellExecute, or through
CreateProcess [which underlies it], through a shortcut, etc) -- and it
does not help for an interpreter (you'd only learn about Python.Exe or
thereabouts, not which script it started out executing!).


Alex






More information about the Python-list mailing list