title: Force a 3rd-party program to flush its output when called through subprocess
body: <p>I am using a 3rd-party python module which is normally called through terminal commands. When called through terminal commands it has a verbose option which prints to terminal in real time.</p>
  
  <p>I then have another python program which calls the 3rd-party program through subprocess. Unfortunately, when called through subprocess the terminal output no longer flushes, and is only returned on completion (the process takes many hours so I would like real-time progress).</p>
  
  <p>I can see the source code of the 3rd-party module and it does not set printing to be flushed such as <code>print('example', flush=True)</code>. Is there a way to force the flushing through my module without editing the 3rd-party source code? Furthermore, can I send this output to a log file (again in real time)?</p>
  
  <p>Thanks for any help.</p>