I want to print onto console while saving the same output in a file using the file attribute in the print call:
print('hello world', file=out_file)
However, this only writes to out_file and does not show anything on the console. I strictly want to use the print statement to avoid duplicating many strings.