Larry Bates wrote: >> How to get the name of the running .py file like the macro _FILE_ in C?
> import os > import sys > print sys.argv[0] > > or if you just want the script and not the full path > > print os.path.basename(sys.argv[0]) except that __FILE__ is the name of the current source file, not the name of the main program. the global name __file__ is a better choice; when definied, it points to the file from which the current module was loaded (this might be a byte code file or a shared library). also see: http://pyref.infogami.com/__file__ </F> -- http://mail.python.org/mailman/listinfo/python-list