Advertisement
Kagalive

bruteforce.py

Jan 16th, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.94 KB | None | 0 0
  1. #Numerical alphabet
  2.  
  3. #Globals
  4. i = 0
  5. j = 0
  6. k = 0
  7. isRunning = False
  8. isNotRunning = not isRunning
  9.  
  10. class Alphabet():
  11.     def __init__(self):
  12.         self.alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
  13.                          "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
  14.                          "!", "@", "#", "%", "^", "&", "*", "(", ")"]
  15.  
  16.  
  17.     # Function to get a letter
  18.     def get_letter(self, letter):
  19.         letter = self.alphabet[letter]
  20.         return letter
  21.  
  22.     # Function to print a letter to console
  23.     def print_letter(self, letter):
  24.         return print(self.alphabet[letter])
  25.  
  26.     def get_all(self):
  27.         for x in self.alphabet:
  28.             print(str(x))
  29.  
  30.  
  31. #instantiation
  32. alpha = Alphabet()
  33.     #alpha.print_letter(3)
  34.  
  35. #Run
  36.  
  37. file = open("test1.txt","w")
  38. for y in alpha.alphabet:
  39.     writer = str(y)
  40.     file.write(writer)
  41.     file.write("\n")
  42.  
  43.     for z in alpha.alphabet:
  44.         writer = str(y+z)
  45.         file.write(writer)
  46.         file.write("\n")
  47.  
  48.         for za in alpha.alphabet:
  49.             writer = str(y+z+za)
  50.             file.write(writer)
  51.             file.write("\n")
  52.  
  53.             for zb in alpha.alphabet:
  54.                 writer = str(y+z+za+zb)
  55.                 file.write(writer)
  56.                 file.write("\n")
  57.  
  58.                 for zc in alpha.alphabet:
  59.                     writer = str(y+z+za+zb+zc)
  60.                     file.write(writer)
  61.                     file.write("\n")
  62.  
  63.                     for zd in alpha.alphabet:
  64.                         writer = str(y + z + za + zb + zc + zd)
  65.                         file.write(writer)
  66.                         file.write("\n")
  67.  
  68.                         for ze in alpha.alphabet:
  69.                             writer = str(y + z + za + zb + zc + zd +ze)
  70.                             file.write(writer)
  71.                             file.write("\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement