Last active
December 25, 2015 11:18
-
-
Save ntlk/6967437 to your computer and use it in GitHub Desktop.
sort tool imagined in python
This file contains 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
import sys | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-r', action='store_const', const=True, required=False) | |
args = parser.parse_args() | |
lines = sys.stdin.readlines() | |
lines.sort(reverse = args.r) | |
for line in lines: | |
sys.stdout.write(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment