#!/usr/bin/env python import sys import click def chop(container, start, end): if end is None: return container[start-1] return container[start-1:end-1] @click.command() @click.argument('start', type=int) @click.argument('end', type=int, default=None, required=False) def main(start, end=None): if sys.stdin.isatty(): sys.stderr.write(f"this program only works with data from STDIN for now...\n") raise SystemExit(0x54) for line in sys.stdin.readlines(): print(chop(line.split(), start, end)) if __name__== '__main__': main()