Jason Jiang wrote:
> Hi,
> 
> How to get the name of the running .py file like the macro _FILE_ in C?
> 
> Thanks.
> Jason 
> 
> 
> 
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])

-Larry Bates
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to