I have a Python script running on a Linux machine which is printing output out to the terminal. Currently, I'm logging this output to a file using the script
command. However, the problem with this approach is that I am not able to read the data added to the file while the script is running; I want to periodically scp
this file onto my local machine to read.
Is there any way I can redirect the output of my script such that file is being appended to and closed after every line is printed?
Thanks.