Search code examples
pythonwindowsshellconsolemingw-w64

MINGW64 doesn't print during execution


I'm using Git Bash to run my Python scripts on Windows. I noticed that the console doesn't print while my scripts are running. All the strings are printed just when the scripts finish. I read that is a buffer and line break issue. How can I fix it?


Solution

  • I solve this including sys.stdout.flush() after each print().