arongsoft 发表于 2017-5-4 12:45:29

python获取执行路径的方法

def current_path():
path=os.path.realpath(sys.path)
if os.path.isfile(path):
path=os.path.dirname(path)
return os.path.abspath(path)
else:
caller_file=inspect.stack()
return os.path.abspath(os.path.dirname(caller_file))
   http://blog.csdn.net/gukesdo/article/details/7101684
页: [1]
查看完整版本: python获取执行路径的方法