I am using myFile.write("...") often and sometimes I’d like to see the output in the console rather than re-opening the updated file. I am using IDLE.
So, I’d like to know, instead of going and replacing myFile.write() with print() everywhere, can I replace the filename (output.txt) with something like STDIO when setting the myFile variable?
myFile = open("output.txt", "w")
You can use the
sysmodule…sys.stderris also available.