Answers for "create a file in python and edit"

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

Code answers related to "create a file in python and edit"

Python Answers by Framework

Browse Popular Code Answers by Language