Name of the Script
paul.moore at uk.origin-it.com
Mon Mar 5 16:40:08 CET 2001
On Mon, 5 Mar 2001 16:17:38 +0100 , Pearu Peterson <pearu at cens.ioc.ee>
>--- a.py ---
>might be what you want.
Close, but not quite...
OK, so you could say "don't do that". But if I'm looking at some code
deep in a big program, can I be *sure* that no-one has changed
directory on me?
Interestingly, although the __name__ symbol has the value __main__ in
a script being run as a "main program", the __file__ symbol doesn't
exist. That's a pity, as it would probably be what I wanted...
More information about the Python-list