python中__file__
用__file__ 来获得脚本所在的路径,比如文件在/root下
cat tee
#!/usr/bin/env python
print __file__ #得到相对路径tee
——————————————————————————————————————
import os
#!/usr/bin/env python
print os.path.realpath(__file__) #得到绝对路径/root/tee