How do I force Python\'s print function to output to the screen?
This is not a duplicate of Disable output buffering - the linked question is attempting unbuffe
Also as suggested in this blog one can reopen sys.stdout in unbuffered mode:
sys.stdout
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
Each stdout.write and print operation will be automatically flushed afterwards.
stdout.write
print