Skip to content

Instantly share code, notes, and snippets.

@Jonty
Forked from ntlk/sort.py
Last active December 25, 2015 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jonty/6967636 to your computer and use it in GitHub Desktop.
Save Jonty/6967636 to your computer and use it in GitHub Desktop.
import sys
lines = sys.stdin.readlines()
lines.sort(reverse = ('-r' in sys.argv))
print ''.join(lines)
@ntlk
Copy link

ntlk commented Oct 13, 2013

Oh, I didn't know about sys.argv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment