Im trying to send all my outputs to a file,not exclusively print statements but all statements,I'm running an algorithm which gives outputs of its own and some logger outputs,
Right now Im trying
f = open('/mnt/sdc1/Ryan/Test/output_logs/{}.txt'.format(file),'w')
sys.stdout=f
but this outputs only the print statements,
I have also tried experimenting with
f = open('/mnt/sdc1/Ryan/Test/output_logs/{}.txt'.format(file),'w')
sys.stderr=f
but this too does not give me everything that the terminal outputs, Any suggestions would be helpful,Thanks in advance.