Created
May 29, 2018 11:04
-
-
Save davidfoerster/54be942d06cd3b93d4175e153cc55365 to your computer and use it in GitHub Desktop.
Improvements on https://askubuntu.com/a/1035732/175814
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys | |
with open(sys.argv[1]) as dict_file: | |
dictionary = dict(line.rstrip('\n').split(None, 1) for line in dict_file) | |
with sys.stdin: | |
for line in sys.stdin: | |
line = line.rstrip('\n') | |
print(dictionary.get(line, line)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment