Skip to content

Instantly share code, notes, and snippets.

@avian2
Created December 22, 2018 14:03
Show Gist options
  • Save avian2/e3968bf933212ee561410b15495e626f to your computer and use it in GitHub Desktop.
Save avian2/e3968bf933212ee561410b15495e626f to your computer and use it in GitHub Desktop.
import sys
from_string = sys.argv[1]
to_string = sys.argv[2]
with open("input.txt") as f:
text = f.read()
text = text.replace(from_string, to_string)
with open("output.txt", "w") as f:
f.write(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment