Answers for "how do i write to a text 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 do i write to a text file in python"

Python Answers by Framework

Browse Popular Code Answers by Language