current script path via execfile?

Adam Pletcher adam at volition-inc.com
Tue Nov 13 11:42:04 EST 2007


I have an app with an embedded Python interpreter.  In that interpreter,
I want to use "execfile" (or something similar) to execute a script from
disk.  The script needs to somehow acquire the full path to itself, but
I can't work out how to do this.

 

Since it's run with execfile in the embedded interpreter, there's no
sys.argv to look at.  Is there another way to get the current script's
full pathname?

 

Thanks in advance.

 

- Adam

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071113/1ae4d4cc/attachment.html>


More information about the Python-list mailing list