Answers for "how to write data into a file in python"

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 "how to write data into a file in python"

Python Answers by Framework

Browse Popular Code Answers by Language