tiedosto = input("Anna luettavan tiedoston nimi: ") #Here i take user added "File"
sana = input("Sana joka korvataan: ") #Here is word that i want to replace
korvaa = input("Sana jolla korvataan: ") #Here is word that i want to replace
td = open(tiedosto,"r+")#here we open the file
for line in td:
muutos = td.read().replace(sana, korvaa) #Here it replaces the words
td.write(muutos)#Doesent work?
print(muutos)
td.close()
So the td.write(muutos) why doesent it save to the file?