I have a python script running on startup in the background. Its print commands do not come through to the bash console as they do when calling the script manually with e.g. python script.py
. Output and errors can be redirected to file by calling python script.py > log.txt 2>&1
. But after startup, as the script runs, I can see the log file but it has zero size, so is presumably waiting for the script to end. Calling it with cat
returns nothing. I've tried using append >> instead with no luck.
Is there any way to make the output happen in real time, so it can be viewed?