title: Pyinstaller: setting unbuffered stdio on python 2.7 on Windows
body: <p>I have a Windows 10 python script that I usually run using the following command:-</p>
  <pre><code>python -u my_python_application.py
  </code></pre>
  <p>The <code>-u</code> option is used to force stdin, stdout and stderr to be totally <a href="https://docs.python.org/2/using/cmdline.html#cmdoption-u" rel="nofollow noreferrer">unbuffered</a>. This gives my application an instantaneous feel, and without it there is a delay where data is logged after the operation occurs.</p>
  <p>I am now trying to create an executable through Pyinstaller. So far everything is working as expected and I can generate an executable which I can run without any major issues. However, the generated executable does not have the unbuffered stdio option, and as a result my application is not as instantaneous/responsive as its non-executable form. So my question is: <strong>Is there anyway to force stdio to be totally unbuffered when using Pyinstaller?</strong></p>
  <p>I have found similar unanswered posts here:-</p>
  <ul>
  <li><a href="https://www.mail-archive.com/pyinstaller@googlegroups.com/msg00841.html" rel="nofollow noreferrer">Pyinstaller unbuffered runtime option</a></li>
  <li><a href="https://stackoverflow.com/questions/52302361/pyinstaller-unbuffered-stdio">Pyinstaller unbuffered stdio</a></li>
  <li><a href="https://github.com/pyinstaller/pyinstaller/issues/1441" rel="nofollow noreferrer">Pyinstaller examine handling of u option</a></li>
  </ul>
  <p>I am using Python v2.7.13 and Pyinstaller v3.6 on a Windows 10 machine.</p>