source: main/waeup.sirp/branches/ulif-experimental-folders/src/waeup/sirp/tests/util.py @ 10222

Last change on this file since 10222 was 3521, checked in by adiwidjaja, 16 years ago

Initial checkin of workshop result.

  • Property svn:eol-style set to native
File size: 661 bytes
Line 
1
2import random
3
4def get_randstring(length):
5    result = ''
6    for i in range(1, length):
7        result += random.choice('abcdefghijklmnopqrstuvwxyz')
8    return result
9
10def get_randname():
11    result = ''
12    n1 = get_randstring(random.randint(4, 15))
13    n2 = get_randstring(random.randint(4, 15))
14    n3 = get_randstring(random.randint(4, 15))
15    #n1[0] = n1[0].upper()
16    #n2[0] = n2[0].upper()
17    #n3[0] = n3[0].upper()
18    return '"%s %s %s"' % (n1, n2, n3)
19
20def get_namelist(num):
21    return [get_randname() for x in range(0, num)]
22
23random.seed()
24fd = open('namelist.txt', 'w')
25for name in get_namelist(70000):
26    fd.write(name + '\n')
27fd.close()
Note: See TracBrowser for help on using the repository browser.