name of this python program

Scott David Daniels Scott.Daniels at Acm.Org
Wed Mar 10 13:11:25 EST 2004


leo wrote:

> hi there
> 
> when i start a python script with 
>         python myprog.py 
> how can i find out the name of my script ("myprog.py") inside the script
> itself. looking for something like args[0]...
> 
> cheers, leo
Depending on your python version, you might try for __file__.

-- 
-Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list