Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('test1') as file_in:
- text = file_in.read()
- text = text.replace("TEST_OLD", "TEST_NEW")
- with open("test2", "w") as file_out:
- file_out.write(text)
- oldfile = open("file", "r")
- newfile = open("file_new", "w")
- for line in oldfile:
- s = line.replace("TEST_OLD","TEST_NEW")
- newfile.write(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement