Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- global codes
- from threading import Thread
- ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
- class makelargecode(Thread):
- def __init__(self,n):
- Thread.__init__(self)
- self.n = n
- self.codes = ''
- def makecode(self):
- for i in range(0,10):
- self.codes += random.choice(ascii_uppercase)
- return self.codes
- @staticmethod
- def wr(code):
- f = open("code.txt","a+")
- f.write(code+"\n")
- f.close
- def run(self):
- for i in range(10000000):
- makelargecode.wr(makelargecode(10).makecode())
- print "Done"
- if __name__ == "__main__":
- task = makelargecode(8)
- task.start()
- task.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement