I have a python script_1 which will be used to call another python script_2 using subprocess. When I do that I can see so many print statements and ouputs on the python console (or cmd). How can I redirect this output to a file along with displaying the output on the python console.
Basically, I need a windows executable command for ' | & tee ' command of Linux. I tried many methods and all those didn't work.
Thanks for the help. :)
loggingpackage with two handlers (one logging to stderr and one logging to file).cmdmight be{your python command line} > file.log & type file.log, although this will display the text only after your scripts have finished execution, of course...