Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import fileinput
- def find_and_replace(filename, old, new):
- for line in fileinput.FileInput(filename, inplace=True):
- line = line.replace(old, new)
- sys.stdout.write(line)
- find_and_replace(sys.argv[1], sys.argv[2], sys.argv[3])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement