python获取当前运行程序的名字

import os

filename = os.path.abspath(__file__)

print filename

打印结果:

E:\bluedon\test.py