4 from common
import sort_items
7 print "Merge and sort all text dictionaries"
8 print "Usage: ", sys.argv[0],
"[input1] [input2] … [inputN] [output]"
12 for i
in range(1, len(sys.argv) - 1):
13 input_file = open(sys.argv[i],
"r")
14 for line
in input_file:
19 output_filename = sys.argv[-1]
20 output_file = open(output_filename,
"w")
21 for line
in all_lines:
22 output_file.write(line)
25 sort_items(output_filename, output_filename)