Skip to content

Instantly share code, notes, and snippets.

@daragh
Created October 6, 2016 19:55
Show Gist options
  • Save daragh/8d30286108171d439627fa9f75e622b5 to your computer and use it in GitHub Desktop.
Save daragh/8d30286108171d439627fa9f75e622b5 to your computer and use it in GitHub Desktop.
#!/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