Created
October 6, 2016 19:55
-
-
Save daragh/8d30286108171d439627fa9f75e622b5 to your computer and use it in GitHub Desktop.
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/env python | |
import sys | |
(code,) = sys.argv[1:] | |
func = eval(code) | |
lines = [line[:-1] if line[-1] == '\n' else iine for line in sys.stdin] | |
lines.sort(key=func) | |
for line in lines: | |
print(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment