answered 2014-07-08 03:47:02 -0500
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.
print