【发布时间】:2019-12-03 14:30:34
【问题描述】:
我正在尝试测试浏览器是否在一个转换为exe 和pyinstaller 的python 程序上打开,有没有办法在不显示窗口并将其转换为exe 的情况下进行测试?
我尝试了 subprocess,但它在 pyinstaller 的窗口模式下产生错误,我无法将 psutil 导入 pyinstaller ("can't import psutil" error)
我使用subprocess的代码:
enter code heresubprocess.check_output('tasklist', shell=True)
程序未启动并出现错误消息:“执行脚本失败” 此处发布了类似的错误:subprocess seems not working in pyinstaller exe file
提前感谢您的回答
【问题讨论】:
-
你能添加更多代码吗?如果没有代码 sn-p 和特定于平台的详细信息,很难掌握您正在处理的问题
-
当然:配置:Windows-10-10.0.0.17134-SP0 Python 3.7.4 PyInstaller:3.4 对于代码:这是一个只有在浏览器打开时才会减少的计时器:全局计时器; e=str(subprocess.check_output('tasklist', shell=True));如果e中的“chrome.exe”或e中的“firefox.exe”或e中的“iexplore.exe”:;计时器-=1;
标签: python process pyinstaller windowed