使用pyinstaller打包python程序,使用-w参数去掉console后,点击exe文件跳出提示窗口显示‘Fail to execute XXXX’
subprocess.check_output,Popen函数需要加入如下参数:
shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE
p = subprocess.Popen(*args,shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
这样就解决了这个问题。
来源:CSDN
作者:Ding_0110M
链接:https://blog.csdn.net/Ding_0110M/article/details/103720031