Answers for "how to overwrite python text in file"

2

how to read then overwrite a file with python

pythonCopywith open('myFolder/myfile.txt', "r") as myfile:
    data = myfilef.read()

with open('myFolder/myfile.txt', "w") as myfile:
    myfile.write(newData)
Posted by: Guest on June-21-2021

Code answers related to "how to overwrite python text in file"

Python Answers by Framework

Browse Popular Code Answers by Language