Adding a __filename__ predefined attribute to 2.5?

Rune Strand rune.strand at gmail.com
Wed Oct 12 03:43:27 EDT 2005


I Steve,

I know it's several ways to isolate the filename. I just want to avoid
the overhead of importing sys or os  to achieve it.

Currently I have this in my scripts:
__filename__ = __file__.replace('\\', '/').rsplit('/', 1)[-1]




More information about the Python-list mailing list