1#!/usr/bin/python 2 3import random 4 5word_len = 5 6alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' 7 8output = open('word_count', 'w') 9words = set() 10N = 1000*1000 11for x in xrange(N): 12 arr = [random.choice(alphabet) for i in range(word_len)] 13 words.add(''.join(arr)) 14 15print len(words) 16for word in words: 17 output.write(word) 18 output.write('\t') 19 output.write(str(random.randint(1, 2*N))) 20 output.write('\n') 21 22