import sys """ First argument is the name of the input file, second argument the length we should decide on""" ifile = open(sys.argv[1]) length = int(sys.argv[2]) of1 = open('small.txt', 'w') of2 = open('large.txt', 'w') for line in ifile: if len(line) < length: of1.write(line) else: of2.write(line)