【发布时间】:2020-06-21 13:38:50
【问题描述】:
我有一个通常使用以下命令运行的 Windows 10 python 脚本:-
python -u my_python_application.py
-u 选项用于强制标准输入、标准输出和标准错误完全为unbuffered。这给了我的应用程序一种即时的感觉,如果没有它,操作发生后记录数据会出现延迟。
我现在正在尝试通过 Pyinstaller 创建一个可执行文件。到目前为止,一切都按预期工作,我可以生成一个可执行文件,我可以在没有任何重大问题的情况下运行它。但是,生成的可执行文件没有无缓冲的 stdio 选项,因此我的应用程序不像其不可执行形式那样即时/响应。所以我的问题是:在使用 Pyinstaller 时是否强制 stdio 完全无缓冲?
我在这里找到了类似的未答复帖子:-
- Pyinstaller unbuffered runtime option
- Pyinstaller unbuffered stdio
- Pyinstaller examine handling of u option
我在 Windows 10 机器上使用 Python v2.7.13 和 Pyinstaller v3.6。
【问题讨论】:
标签: python python-2.7 pyinstaller stdio