So I know how to execute a python script and have it output in command window using os.command or even subprocess. Also i know that capturing output into a text file is done via os.command('my command > me.txt".
My question here is: IS there a way to do both of them with one command? ie execute a python script,capture the output to a text file AND have it show on the command window?
If this is not possible here is another question: the command I want to execute takes up to 8 min to finish and writes up to 300 lines in a text file. Can I access the text file while the command is still executing in order to get some data without waiting for the command to finish executing? like access the text file every 1 minute for example?
If neither is possible then this would also do the job: when my command executes succesfully it prints out a Done statement on the cmd as well as many other lines. Can i check in the cmd if that "Done" string was printed or it needs to be captured in a text file for that dearch to happen?