Skip to content

Instantly share code, notes, and snippets.

@tef
Forked from ntlk/sort.py
Last active December 25, 2015 11:19
Show Gist options
  • Save tef/6967689 to your computer and use it in GitHub Desktop.
Save tef/6967689 to your computer and use it in GitHub Desktop.
from sys import stdin, stdout
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-r', action='store_const', const=True, required=False, default=False)
args = parser.parse_args()
stdout.writelines(sorted(stdin.readlines(), reverse = args.r))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment