So how do you go about pickling the lines from stdin? Which program is pickling and why? That seems like a very strange thing to do in this situation. The only time to pickle something is if you need ...
for line in sys.stdin.readlines(): fields = line.split("\t") for field in fields[:250]: file1.write(field + '\t') file1.write('\n') It's just taking the first 250 elements of a list and writing them ...