Last change
on this file since 6146 was
3521,
checked in by adiwidjaja, 17 years ago
|
Initial checkin of workshop result.
|
-
Property svn:eol-style set to
native
|
File size:
661 bytes
|
Line | |
---|
1 | |
---|
2 | import random |
---|
3 | |
---|
4 | def get_randstring(length): |
---|
5 | result = '' |
---|
6 | for i in range(1, length): |
---|
7 | result += random.choice('abcdefghijklmnopqrstuvwxyz') |
---|
8 | return result |
---|
9 | |
---|
10 | def 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 | |
---|
20 | def get_namelist(num): |
---|
21 | return [get_randname() for x in range(0, num)] |
---|
22 | |
---|
23 | random.seed() |
---|
24 | fd = open('namelist.txt', 'w') |
---|
25 | for name in get_namelist(70000): |
---|
26 | fd.write(name + '\n') |
---|
27 | fd.close() |
---|
Note: See
TracBrowser for help on using the repository browser.