Answers for "how to edit a txt python"

1

how to veiw and edit files with python

#write
f = open('helloworld.txt','wb')
f.write('hello world')
f.close()

#read
f = open('helloworld.txt','r')
message = f.read()
print(message)
f.close()
Posted by: Guest on June-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language