Skip to content

Instantly share code, notes, and snippets.

@x1001000
Created May 22, 2021 21:42
Show Gist options
  • Save x1001000/4cae0d70203dc13f2ac7ad3a75095a5d to your computer and use it in GitHub Desktop.
Save x1001000/4cae0d70203dc13f2ac7ad3a75095a5d to your computer and use it in GitHub Desktop.
with open(input()) as f:
old = input()
new = input()
outlines = []
print('=== Before the replacement')
for readline in f.readlines():
print(readline.strip())
outlines.append(readline.replace(old, new))
print('=== After the replacement')
for outline in outlines:
print(outline.strip())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment