For the Python script to print often rather than at the end, the buffer needs to be flushed so output will be written to screen. To enable this, you can do a few things:
- Add “-u” as a command line option to python
- Set the environment variable:
PYTHONUNBUFFERED=TRUE
- Add the “flush=TRUE” option to you print command e.g.:
print(..., flush=True)