Demonstrates writing to a text file : Text File Write : File PYTHON examples


PYTHON examples » File » Text File Write »

 

Demonstrates writing to a text file


Demonstrates writing to a text file



print "Creating a text file with the write() method."
text_file = open("write_it.txt""w")
text_file.write("Line 1n")
text_file.write("This is line 2n")
text_file.write("That makes this line 3n")
text_file.close()



           
       



Leave a Comment / Note


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


PYTHON examples

 Navioo File
» Text File Write