I want to run an external program from python, redirect output (lots of text) to a log file and wait for that program to finish. I know I can do it via bash:
#! /bin/bash
my_external_program > log_file 2>&1
echo "done"
But how can I do the same with python? Note that with the bash command, I can check the log_file while the program is running. I want this property in python as well.