python中的os.path.realpath(__file__)

python中的os.path.realpath(__file__),取的是脚本的完整路径

[root@leexl ~]# cat tst.py


import os
Root = (os.path.realpath(__file__))
print Root


[root@leexl ~]# python tst.py
/root/tst.py


posted on 2013-06-05 10:21  语辰  阅读(1465)  评论(0编辑  收藏  举报