Print to a file : print « Introduction « Python Tutorial






logfile = open('mylog.txt', 'a')
print >> logfile, 'Fatal error: invalid input!'
logfile.close()








1.10.print
1.10.1.Do calculation in print
1.10.2.Printing with Commas: print more than one expression
1.10.3.If you add a comma at the end, your next print statement will continue printing on the same line
1.10.4.Print to standard error
1.10.5.Print to a file