Guest User

Untitled

a guest
Feb 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. from random import choice
  2. from tkinter import *
  3.  
  4. sy = ["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",
  5. "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",
  6. "1" , "2","3" ,"4" ,"5" ,"6" ,"7","8" ,"9" ,"0","."]
  7.  
  8. root = Tk()
  9. root.title("Simple Password Generator")
  10. root.geometry("400x300")
  11.  
  12. def Generate(event):
  13. print(''.join(choice(sy) for i in range(10)))
  14.  
  15.  
  16. btn = Button(root,
  17. text="Generate",
  18. width=20,height=2,
  19. bg="grey",fg="black",
  20. font='arial 19')
  21. btn.bind("<Button-1>", Generate)
  22. btn.pack()
  23. btn.pack(side='top')
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. root.mainloop()
  31.  
  32. from random import choice
  33. from tkinter import *
  34.  
  35.  
  36. def Generate(event):
  37. tex.insert(END, ''.join(choice(sy) for i in range(10)) + 'n')
  38.  
  39.  
  40. sy = ["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",
  41. "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",
  42. "1" , "2","3" ,"4" ,"5" ,"6" ,"7","8" ,"9" ,"0","."]
  43.  
  44. root = Tk()
  45. root.title("Simple Password Generator")
  46. root.geometry("400x300")
  47.  
  48. btn = Button(root,
  49. text="Generate",
  50. width=20,height=2,
  51. bg="grey",fg="black",
  52. font='arial 19')
  53. btn.bind("<Button-1>", Generate)
  54. btn.pack(side='top')
  55.  
  56. tex = Text(root)
  57. scr = Scrollbar(root, command=tex.yview)
  58. tex.configure(yscrollcommand=scr.set, state=ENABLE)
  59. scr.pack(side='right', fill='y')
  60. tex.pack(fill='both')
  61. root.mainloop()
Add Comment
Please, Sign In to add comment