-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
43 lines (32 loc) · 914 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
import threading
import string
from time import time
import itertools
PrinTable = string.printable.replace(" ",'').replace('\t\n\r\x0b\x0c','').replace("\\",'')
class PrintNumber(threading.Thread):
def __init__(self, n,m):
self.n = n
self.m=m
super(PrintNumber,self).__init__()
def run(self):
print self.n, self.n+self.m
for i in range(self.n, self.n+self.m):
abc = i
def run(m,n):
timea = time()
s= m/n
a = [i*s for i in range(n)]
for i in a:
thread = PrintNumber(i,s)
thread.start()
timeb= time()
print '=----------',timeb-timea,'---------'
m = 20000
n = 10
print len(list(itertools.permutations(list(PrinTable),3)))
comb = list(itertools.permutations(list(PrinTable),3))
combination = []
for each in comb:
eachcomb = ''.join(list(each))
combination.append(eachcomb)