Created
June 9, 2015 03:47
-
-
Save waldronj/a777c9b4b30ba860003e to your computer and use it in GitHub Desktop.
Tail-Challenge
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
| import argparse | |
| import sys | |
| parser = argparse.ArgumentParser(description="Tail Substitute") | |
| parser.add_argument('lines', type=int, default=10, nargs='?', | |
| help="Number of lines to print, default is 10") | |
| args = parser.parse_args() | |
| input_stream = [] | |
| for line in sys.stdin: | |
| input_stream.append(line) | |
| for line in input_stream[len(input_stream) - args.lines:len(input_stream)]: | |
| print line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment