I've been trying to do this, but I'm pretty new at Python, and can't figure out how to make it work.
I have this:
import fileinput
for line in fileinput.input(['tooltips.txt'], inplace=True, backup="bak.txt"):
line.replace("oldString1", "newString1")
line.replace("oldString2", "newString2")
But it just deletes everything from the txt.
What am I doing wrong?
I have tried with print(line.replace("oldString1", "newString1") but it doesn't remove the existing words.
As I said, I'm pretty new at this. Thanks!