Print to a file : Print : Introduction PYTHON TUTORIALS


PYTHON TUTORIALS » Introduction » Print »

 

Print to a file


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



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Introduction
» Print