问题:
使用pyinstaller --onefile --windowed 生成的.exe文件执行后,直接退出,没有任何错误信息。
去掉--windowed后,生成的.exe可以成功执行,但是会有一个console窗口。
Google了一圈之后,说是代码中关于print,stdout的代码要清理掉。最后 确认是subprocess.Popen().stdout造成的。
然后找到了这两篇帖子,得到了解决办法 - 创建一个隐藏的窗口。
http://www.ptt.cc/bbs/Python/M.1366800184.A.3FC.html
http://code.activestate.com/recipes/578300-python-subprocess-hide-console-on-windows/