首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

python获取施行路径的方法

2012-12-21 
python获取执行路径的方法def current_path():pathos.path.realpath(sys.path[0])if os.path.isfile(path

python获取执行路径的方法

def current_path():      path=os.path.realpath(sys.path[0])      if os.path.isfile(path):          path=os.path.dirname(path)          return os.path.abspath(path)      else:          caller_file=inspect.stack()[1][1]          return os.path.abspath(os.path.dirname(caller_file))  
?

?

?

http://blog.csdn.net/gukesdo/article/details/7101684

热点排行