Apr-26-2017, 06:10 AM
Don't use the writer then.
I was thinking that the idea was to redirect print to a file.
I was thinking that the idea was to redirect print to a file.
import io f = io.StringIO() print(text, file=f)This is not using StringIO.write() and should not close the "file"