Answers for "how to read then overwrite a file with python"

1

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 read then overwrite a file with python"

Python Answers by Framework

Browse Popular Code Answers by Language