How Get Name Of Working File

Victor Subervi victorsubervi at gmail.com
Sun Mar 22 10:52:59 EDT 2009


Hi;
If I am writing a script that generates HTML, how do I grab the name of the
actual file in which I am working? For example, let us say I am working in
test.py. I can have the following code:

import os
dir = os.getcwd()

and that will give me the working dir. But what about "test.py"?
TIA,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090322/05eab2a9/attachment.html>


More information about the Python-list mailing list