Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Maybe you are looking for this solution:

import sys
sys.stdout = open('output.txt','w')

print('Hello!')

This way, you only have to use print to write to the file.