Module (File) Name

Roger Upole rupole at compaq.net
Wed Mar 8 22:55:00 EST 2000


import sys
print sys.argv[0]

              Roger Upole

"Joseph C. Kopec" <kopecjc at worldnet.att.net> wrote in message
news:38C71BDB.8705E5D at worldnet.att.net...
> Easy question that I thought I knew the answer to:  If a module is to be
> the main module (so that __name__ == __main__), how do you get the
> module (file) name from within the module/file itself?  Thanks in
> advance.





More information about the Python-list mailing list