name of this python program

Peter Abel PeterAbel at
Wed Mar 10 22:16:33 CET 2004

leo <leo at bella.local> wrote in message news:<m2ptbl54u7.fsf at bella.local>...
> hi there
> when i start a python script with 
>         python 
> how can i find out the name of my script ("") inside the script
> itself. looking for something like args[0]...
> cheers, leo


print 'My modulname: %s' %  __file__

Will give you the filename of your modul.


More information about the Python-list mailing list