How can I save a command output to a file in real-time?
For example, if my command is python log.py where log.py contains:
import time
print('testing')
time.sleep(100) # sleeping for 100 seconds
and if I save the output with python log.py | tee command.log or python log.py > command.log, the command.log file typically won't contain the output of python log.py, namely testing, until it finishes executing. Instead, I don't want to have to wait ~100 seconds to be able to view testing in command.log.