python __file__ 与argv[0]

来源:http://andylin02.iteye.com/blog/933237 python __file__ 与argv[0] 在python下,获取当前执行主脚本的方法有两个:sys.argv[0]和__file__。html sys.argv[0] 获取主执行文件路径的最佳方法是用sys.argv[0],它多是一个相对路径,因此再取一下abspath是保险的作法,像这样:python i
相关文章
相关标签/搜索