Python write a file

74 Views
Published
Python writing files tutorial example explained

#python #writing #files

text = "Yooooooooo\nThis is some text\nHave a good one!\n"

with open('test.txt','w') as file:
file.write(text)
Category
Bro Code
Tags
Python, Python Files, File io
Be the first to comment