使用PyInstaller编译为exe后,Python os.makedir无法正常工作吗?

时间:2019-11-19 19:28:32

标签: python pyinstaller

我正在尝试使用其中的这一行来编译Python代码,它没有建立任何目录,但是其他所有东西都在工作。

os.mkdir('{}\\{}'.format(dir_path, scenario['name']))

我使用--console标志进行编译,运行时没有错误。我也以管理员身份运行。感谢您的帮助。

这是我获取dir_path的方式

if getattr(sys, 'frozen', False):
    dir_path = sys._MEIPASS
else:
    dir_path = os.path.dirname(os.path.abspath(__file__))

0 个答案:

没有答案