我正在使用Subprocess从主应用程序调用另一个Python脚本,扩展名为.py的普通应用程序运行正常。.当我创建可执行文件时,subprocess.call无法运行..没有此类文件或目录错误显示。如何解决此问题,我正在使用python3.5
Main.py
import subprocess
if getattr(sys, 'frozen', False):
base_path = sys._MEIPASS
else:
base_path = ""
exe_path = os.path.join(base_path, 'data\hello.py')
subprocess.Popen(exe_path)
运行可执行文件时,出现以下错误
Traceback (most recent call last):
File "main.py", line 11, in File "subprocess.py", line 947, in init File "subprocess.py", line 1551, in _execute_child FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEICAezgb/data\hello.py'
Py Installer命令为: pyinstaller --add-data“ ./data/*:data” --onefile main.py
关于拉吉