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