python命令行运行py文件中包含__file__会报FileNotFoundError

原python文件中使用os.path.dirname(file),在pycharm中直接运行可正常执行,能够正常找到当前文件夹,但加入argparse使用命令行参数执行时,会报FileNotFoundError: [Errno 2] No such file or directory: ‘’ 搜了一些资料基本是导入模块类的报错,但尝试了下使用os.path.abspath(os.path.dir
相关文章
相关标签/搜索