#!/usr/bin/env python """Read lines from stdin, print them to stdout unless they're too long. By default, "too long" is > 220 characters, but if you pass an argument, it will be used as the length limit instead.""" import sys limit = 220 if len(sys.argv) > 1: limit = int(sys.argv[1]) line = sys.stdin.readline() while line != "": if len(line) <= limit: sys.stdout.write(line) line = sys.stdin.readline()