I\'m used to doing print >>f, \"hi there\"
print >>f, \"hi there\"
However, it seems that print >> is getting deprecated. What is the recommended way t
print >>
One can also use the io module as in:
io
import io my_string = "hi there" with io.open("output_file.txt", mode='w', encoding='utf-8') as f: f.write(my_string)