-
Notifications
You must be signed in to change notification settings - Fork 0
/
passcode gen gui.py
76 lines (34 loc) · 1.45 KB
/
passcode gen gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from tkinter import *
import pyperclip
import random
root = Tk()
root.geometry("700x300")
passwrd = StringVar()
passlen = IntVar()
passlen.set(0)
#function to generate
def generate():
pass1 = ['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', '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', '1', '2', '3', '4', '5', '6', '7', '8',
'9', '0', ' ', '!', '@', '#', '$', '%', '^', '&',
'*', '(', ')']
password = ""
for x in range(passlen.get()):
password = password + random.choice(pass1)
passwrd.set(password)
#function to copy the passcode
def copyclipboard():
random_password = passwrd.get()
pyperclip.copy(random_password)
Label(root, text="Strong Password Generator", font="Courier 30 bold").pack()
Label(root, text="Devloped by Karunakaran V", font="Courier 20 italic").pack()
Label(root, text="Enter the number to get password").pack(pady=3)
Entry(root, textvariable=passlen).pack(pady=3)
Button(root, text="Tap to get", command=generate).pack(pady=7)
Entry(root, textvariable=passwrd).pack(pady=3)
Button(root, text="Tap to copy clipboard", command=copyclipboard).pack()
root.mainloop()