Guest User

Untitled

a guest
Nov 21st, 2024
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.84 KB | None | 0 0
  1. from tkinter import *
  2. import random
  3.  
  4.  
  5. namepart1 = ['Adventuring', 'Baking', 'Chasing', 'Dancing', 'Evolving', 'Fluctuating', 'Glimmering', 'Humming', 'Imaging', 'Juggling', 'Kicking', 'Leaping', 'Moving', 'Nurturing', 'Opening', 'Pondering', 'Quivering', 'Rising', 'Singing', 'Tinkering', 'Unfolding', 'Vibrating', 'Wandering', 'X-raying', 'Yearning', 'Zoning', 'Absorbing', 'Bouncing', 'Crawling', 'Dreaming', 'Escaping', 'Fading', 'Gazing', 'Hovering', 'Inspiring', 'Jumping', 'Kneeling', 'Lurking', 'Murmuring', 'Nestling', 'Observing', 'Paddling', 'Questing', 'Reaching', 'Sinking', 'Twirling', 'Unraveling', 'Venting', 'Whispering', 'X-raying', 'Yelling', 'Zipping', 'Asking', 'Bringing', 'Caring', 'Dreading', 'Engaging', 'Filling', 'Gliding', 'Hoping', 'Immersing', 'Jostling', 'Kissing', 'Leaking', 'Mimicking', 'Navigating', 'Opening', 'Pushing', 'Quenching', 'Reeling', 'Spinning', 'Throbbing', 'Unveiling', 'Vowing', 'Weaving', 'Xploring', 'Yearning', 'Zapping', 'Awakening', 'Bending', 'Creeping', 'Daring', 'Echoing', 'Flickering', 'Grinning', 'Holding', 'Infiltrating', 'Jumping', 'Kicking', 'Listening', 'Murmuring', 'Nurturing', 'Opening', 'Peering', 'Quenching', 'Reverberating', 'Swirling', 'Tugging', 'Unleashing', 'Veiling', 'Waving', 'X-ing', 'Yearning', 'Zipping', 'Accusing', 'Breaking', 'Craving', 'Dawning', 'Engulfing', 'Fading', 'Growing', 'Hiding', 'Interpreting']
  6. namepart2 = ['Ethereal', 'Luminous', 'Mystical', 'Resplendent', 'Serene', 'Vibrant', 'Whimsical', 'Majestic', 'Quaint', 'Enigmatic', 'Opulent', 'Radiant', 'Sublime', 'Nostalgic', 'Elusive', 'Fleeting', 'Celestial', 'Timeless', 'Transcendent', 'Velvety', 'Peculiar', 'Charming', 'Graceful', 'Infinite', 'Eloquent', 'Lustrous', 'Sparks', 'Ebullient', 'Lush', 'Glorious', 'Dazzling', 'Breathtaking', 'Reverent', 'Sculptural', 'Vast', 'Tranquil', 'Quixotic', 'Uplifting', 'Idyllic', 'Iridescent', 'Heavenly', 'Piquant', 'Soothing', 'Euphoric', 'Timid', 'Robust', 'Tantalizing', 'Delicate', 'Dreamlike', 'Magnetic', 'Exquisite', 'Harmonious', 'Spirited', 'Gossamer', 'Seraphic', 'Breezy', 'Whispering', 'Chimeric', 'Turbulent', 'Gleaming', 'Wistful', 'Fanciful', 'Mysterious', 'Opalescent', 'Vivid', 'Languid', 'Resilient', 'Chimerical', 'Lucid', 'Boisterous', 'Immaculate', 'Dramatic', 'Translucent', 'Playful', 'Frosted', 'Vivacious', 'Abstract', 'Gentle', 'Delightful', 'Breathtaking', 'Sovereign', 'Epic', 'Flawless', 'Vibrating', 'Frostbitten', 'Incandescent', 'Fierce', 'Enchanted', 'Unfathomable', 'Crisp', 'Endearing', 'Dazzling', 'Majestic', 'Bubbly', 'Seraphic', 'Mellow', 'Restorative', 'Illustrious', 'Bold', 'Gleaming']
  7. namepart3 = ['Acorn', 'Bamboo', 'Candelabra', 'Dragonfly', 'Eclipse', 'Feather', 'Geode', 'Hologram', 'Igloo', 'Jellyfish', 'Kaleidoscope', 'Lantern', 'Meteor', 'Nautilus', 'Ocarina', 'Pyramid', 'Quicksilver', 'Raven', 'Seashell', 'Telescope', 'Umbrella', 'Vortex', 'Wagonwheel', 'Xenon', 'Yarn', 'Zeppelin', 'Albatross', 'Brassica', 'Cicada', 'Djembe', 'Ewer', 'Fossil', 'Geyser', 'Hermit crab', 'Icicle', 'Jukebox', 'Koi', 'Lighthouse', 'Moonstone', 'Ninja star', 'Octopus', 'Parchment', 'Quartz', 'Rattle', 'Sundial', 'Tarantula', 'Ukelele', 'Volcano', 'Whirlpool', 'Xylograph', 'Yew', 'Ziggurat', 'Anemone', 'Birch', 'Chalice', 'Dune', 'Elderflower', 'Fresco', 'Glacier', 'Howler monkey', 'Iris', 'Jaguar', 'Kite', 'Lyre', 'Mannequin', 'Nebula', 'Ostrich', 'Pinecone', 'Quill', 'Rook', 'Stalactite', 'Topaz', 'Urn', 'Vinegaroon', 'Windmill', 'Xylophone', 'Yen', 'Zephyr', 'Amethyst', 'Bumblebee', 'Cairn', 'Driftwood', 'Eagle', 'Fern', 'Gale', 'Hornet', 'Ivory', 'Jade', 'Kraken', 'Lava lamp', 'Mushroom', 'Nymph', 'Obelisk', 'Penny', 'Quartzite', 'Rocket', 'Starfish', 'Treehouse', 'Urchin', 'Violet', 'Woodpecker', 'Xenomorph', 'Yggdrasil', 'Ziggurat', 'Abyss', 'Bellflower', 'Cedar', 'Dandelion', 'Eruption', 'Fungi', 'Giraffe', 'Helix', 'Iguana', 'Jigsaw', 'Kingfisher', 'Labyrinth', 'Meteorite', 'Neptune', 'Orchid', 'Pineapple', 'Quicksand', 'Raven', 'Sapphire', 'Turtle', 'Uproar', 'Vortex', 'Willow', 'Xerox', 'Yarn', 'Zebra', 'Astronaut', 'Basilisk', 'Comet', 'Dolphin', 'Ember', 'Fungi', 'Glimmer', 'Hydra', 'Inkblot', 'Jetstream', 'Kettle', 'Lobster', 'Manta ray', 'Nautilus', 'Oasis', 'Plumeria', 'Quartz', 'Raspberry', 'Shimmer', 'Tornado', 'Urchin', 'Viper', 'Wormhole', 'Xylocarp', 'Yeti', 'Zodiac', 'Admiral', 'Beetle', 'Caravel', 'Dagger', 'Echo', 'Fur', 'Goblet', 'Harlequin', 'Icicle', 'Jewel', 'Kangaroo', 'Lotus', 'Magma', 'Nightingale', 'Onyx', 'Petrichor', 'Quiver', 'Ravine', 'Sundew', 'Trophy', 'Umbra', 'Vulture', 'Wisp', 'Xerophyte', 'Yew tree', 'Zinnia']
  8.  
  9. lower = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  10. upper = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
  11. special_chars = [
  12. "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/",
  13. ":", ";", "<", "=", ">", "?", "@", "[", "]", "^", "_", "`", "{", "|", "}", "~",
  14. ]
  15. numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
  16.  
  17. name = namepart1[random.randint(0, len(namepart1) - 1)] +namepart2[random.randint(0, len(namepart2) - 1)] + namepart3[random.randint(0, len(namepart3) - 1)]
  18. print(name)
  19. root = Tk()
  20. root.geometry('400x125')
  21. root.resizable(0,0)
  22. root.title("accounmt generator")
  23. Text = ''
  24.  
  25. def Check1():
  26. print(":)")
  27. SettingsRead = open('Settings.txt', 'r+')
  28. A = str(Special.get())
  29. B = str(Lower1.get())
  30. C = str(Numbers.get())
  31. D = str(Upper.get())
  32. N = A + B + C + D
  33. SettingsRead.write(N)
  34. SettingsRead.close()
  35. def changeName():
  36. name = namepart1[random.randint(0, len(namepart1) - 1)] +namepart2[random.randint(0, len(namepart2) - 1)] + namepart3[random.randint(0, len(namepart3) - 1)]
  37. displayedName1.config(text=name)
  38. root.update()
  39. button1.place(x=displayedName1.winfo_width(), y=25)
  40. root.update()
  41. print('Clicked', name)
  42. def Entrytext():
  43. Text = e1.get()
  44. Text = str(Text)
  45. print(Text)
  46.  
  47.  
  48.  
  49.  
  50.  
  51. def enterLength():
  52. root.update()
  53. password = []
  54. Text1 = e2.get()
  55.  
  56. if Text1 == '':
  57. Text1=10
  58.  
  59. Text1 = int(Text1)
  60. for i in range(Text1):
  61. if Special.get()==1:
  62. password.append(special_chars[random.randint(1, len(special_chars)-1)])
  63. if Lower1.get()==1:
  64. password.append(lower[random.randint(1, len(lower)-1)])
  65. if Upper.get()==1:
  66. password.append(upper[random.randint(1, len(upper)-1)])
  67. if Numbers.get()==1:
  68. password.append(numbers[random.randint(1, len(numbers)-1)])
  69.  
  70. random.shuffle(password)
  71.  
  72. if len(password) != Text1:
  73. X = len(password) - Text1
  74. for i in range(X):
  75. password.pop()
  76. password1 = ''
  77. password1 = password1.join(password)
  78. passwordLabel.config(text=password1)
  79. changePassword.place(y=75, x=label1.winfo_width()+ passwordLabel.winfo_width()+3)
  80. root.update()
  81. print(password1)
  82. X = Label(root, text='Application =')
  83. X.place(x=1, y=3)
  84. e1=Entry(root, width=25)
  85. e1.place(x=80, y=3)
  86. button = Button(root, text="Enter",
  87. command=Entrytext)
  88. button.place(x=235, y=0)
  89.  
  90.  
  91.  
  92. displayedName1 = Label(root, text=name)
  93. displayedName1.place(x=0, y=25)
  94.  
  95. button1 = Button(root, text="Change Name", command=changeName)
  96. root.update()
  97. button1.place(x=displayedName1.winfo_width()+3, y=25)
  98. print(displayedName1.winfo_width())
  99. root.update()
  100.  
  101. #password
  102. Y = Label(root, text='Length Of Password =')
  103. Y.place(x=1, y=52)
  104. root.update()
  105. e2=Entry(root, width=5)
  106. e2.place(x=Y.winfo_width(), y=52)
  107. root.update()
  108. button2 = Button(root, text="Enter", command=enterLength)
  109. button2.place(y=52, x=e2.winfo_width()+Y.winfo_width()+4)
  110.  
  111. Text1 = 10
  112. password = []
  113.  
  114. SettingsRead = open('Settings.txt', 'r')
  115. if SettingsRead.read(1) != '':
  116. SettingsRead.close()
  117. SettingsRead = open('Settings.txt', 'r')
  118. Q = SettingsRead.read(1)
  119. W = SettingsRead.read(1)
  120. E = SettingsRead.read(1)
  121. R = SettingsRead.read(1)
  122. print('Value =',Q,W,E)
  123. SettingsRead.close()
  124.  
  125. Special = IntVar(value=int(Q))
  126. checkbox1 = Checkbutton(root, text='Special Charicters', variable=Special, onvalue=1, offvalue=0, command=Check1)
  127. checkbox1.place(x= 3, y=100)
  128.  
  129. root.update()
  130. Lower1 = IntVar(value=int(W))
  131. checkbox2 = Checkbutton(root, text='Lower Case', variable=Lower1, onvalue=1, offvalue=0, command=Check1)
  132. checkbox2.place(x= checkbox1.winfo_width(), y=100)
  133. root.update()
  134.  
  135. Upper = IntVar(value=int(E))
  136. checkbox3 = Checkbutton(root, text='Upper Case', variable=Upper, onvalue=1, offvalue=0, command=Check1)
  137. checkbox3.place(x= checkbox2.winfo_width()+checkbox1.winfo_width() , y=100)
  138. root.update()
  139.  
  140. Numbers = IntVar(value=int(R))
  141. checkbox4 = Checkbutton(root, text='Numbers', variable=Numbers, onvalue=1, offvalue=0, command=Check1)
  142. checkbox4.place(x= checkbox2.winfo_width()+checkbox1.winfo_width()+checkbox3.winfo_width(), y=100)
  143. root.update()
  144.  
  145. SettingsRead = open('Settings.txt', 'r')
  146. if SettingsRead.read(1) == '':
  147. A = str(Special.get())
  148. B = str(Lower1.get())
  149. C = str(Numbers.get())
  150. D = str(Upper.get())
  151. N = A + B + C + D
  152. SettingsWrite = open('Settings.txt', 'r+')
  153. SettingsWrite.write(N)
  154. SettingsWrite.close()
  155. SettingsRead.close()
  156.  
  157.  
  158. for i in range(Text1):
  159. if Special.get()==1:
  160. password.append(special_chars[random.randint(1, len(special_chars)-1)])
  161. if Lower1.get()==1:
  162. password.append(lower[random.randint(1, len(lower)-1)])
  163. if Upper.get()==1:
  164. password.append(upper[random.randint(1, len(upper)-1)])
  165. if Numbers.get()==1:
  166. password.append(numbers[random.randint(1, len(numbers)-1)])
  167. random.shuffle(password)
  168. print(password)
  169.  
  170. if len(password) != Text1:
  171. X = len(password) - Text1
  172. for i in range(X):
  173. password.pop()
  174. password1 = ''
  175. password1 = password1.join(password)
  176. print(password1, len(password1))
  177. root.update()
  178. passwordLabel = Label(root, text=password1)
  179. label1 = Label(root, text='Password = ')
  180. changePassword = Button(root, text='Change password', command=enterLength)
  181.  
  182. label1.place(y= 75, x=3)
  183. root.update()
  184. passwordLabel.place(y=75, x=label1.winfo_width())
  185. root.update()
  186. changePassword.place(y=75, x=label1.winfo_width()+ passwordLabel.winfo_width()+3)
  187.  
  188.  
  189. #Savinging Data
  190. def Save():
  191. root.update()
  192. Aplication = str(e1.get())
  193. Aplication = Aplication + ' '
  194. print(Aplication)
  195. Name = displayedName1['text']
  196. Name = Name + ' '
  197. print(Name)
  198. Pass = passwordLabel['text']
  199. Pass = Pass + ' '
  200. print(Pass)
  201. SaveData = Aplication + Name + Pass + '\n'
  202. print(SaveData)
  203.  
  204. P = open('Accounts.txt', 'a')
  205. P.write(SaveData)
  206. P.close()
  207.  
  208.  
  209.  
  210. Save = Button(root, text='Save', command=Save)
  211. Save.place(x=50, y=50)
  212.  
  213. root.mainloop()
  214.  
  215.  
  216.  
Advertisement
Add Comment
Please, Sign In to add comment