当我使用tkinter
运行它时,我在PyCharm
中的程序运行良好,当我使用pyinstaller创建.exe
文件时,
pyinstaller -i"icon.ico" -w -F script.py
我没有错。我在script.exe
和我的script.py
相同的文件夹中粘贴subprocess
,运行之后我认为在print
的步骤中,它没有回答,因为我在子进程线和它的工作之前有import subprocess
from subprocess import Popen, PIPE
s = subprocess.Popen([EXE,files,'command'],shell=True, stdout=subprocess.PIPE)
。
谁知道为什么?
这是子进程的行:
s = subprocess.check_output([EXE,files,'command'],shell=True, stderr=subprocess.STDOUT)
编辑:
同样的问题:
s = subprocess.Popen([EXE,files,'command'],shell=True, stdout=subprocess.PIPE)
您可以在-w模式或--windowed中编译代码,但是您还必须分配stdin和stderr。
所以改变:
s = subprocess.Popen([EXE,files,'command'],shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
至:
-w
通过不使用qazxswpoi命令从.py脚本生成exe文件来解决问题。