Did you set PYTHONUNBUFFERED=TRUE?
Python by default starts buffering output when it's not connected to a PTY, which causes a lot of issues with interactive output.
Python by default starts buffering output when it's not connected to a PTY, which causes a lot of issues with interactive output.