Advertisement
flypip

Flymdp (createur de mdp)

Nov 22nd, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.66 KB | None | 0 0
  1. import os, time, random
  2.  
  3. with open("bibli.txt", "a") as f:
  4.    code = ""  
  5.    x = 10      
  6.    nbr = 0
  7.    mots = []
  8.    caracters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v","w",
  9.                 "x", "y", "z","A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
  10.                 "U", "V","W","X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v","w",
  11.                 "x", "y", "z","A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
  12.                 "U", "V","W","X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v","w",
  13.                 "x", "y", "z","A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
  14.                 "U", "V","W","X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",]      
  15.  
  16.    while 1:
  17.    
  18.         try:
  19.        
  20.                 a = random.sample(caracters,  x)
  21.                 code = ""
  22.                 for b in a:
  23.                         code = code + b
  24.                 print code+"\n"
  25.        
  26.                 if code in mots:
  27.                         print "damn"
  28.                 else:
  29.                    f.write(code + "\n")
  30.                 nbr = nbr + 1
  31.                
  32.         except KeyboardInterrupt:
  33.                 print str(nbr) + "codes trouvees"
  34.                 raw_input()
  35.  
  36.  
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement