python的os.path.dirname(__file__)

os.path.dirname(__file__)返回运行脚本的路径。当用绝对路径的命令行运行时返回完整绝对路径的目录,而相对路径运行时则返回空字符串。

posted on 2017-10-23 15:38  vyouman  阅读(310)  评论(0)    收藏  举报