Answers for "python how to create and write to a file"

3

python write to file

with open("test.txt",'w',encoding = 'utf-8') as f:
   f.write("my first filen")
   f.write("This filenn")
   f.write("contains three linesn")
Posted by: Guest on October-16-2020

Code answers related to "python how to create and write to a file"

Python Answers by Framework

Browse Popular Code Answers by Language