I\'ve been struggling with this for quite a while. I\'ve managed to write a code that can capture STDOUT of .py files, however when I run the exact same code with e
.py
It seems that when you compile the script you should set the flush of the print to True, so just change it to:
import time if __name__ == "__main__": num = 0 while True: num = num + 1 print(num, flush=True) time.sleep(3)