-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassword_generator.py
45 lines (33 loc) · 1.07 KB
/
password_generator.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
from tkinter import*
import string
import random
root=Tk()
root.geometry("480x300")
root.title("PASSWORD GENERATOR")
root.configure(background="#caf0f8")
def gen():
num = int(e1.get())
s1 = string.ascii_lowercase
s2 = string.ascii_lowercase
s3 = string.digits
s4 = string.punctuation
s=[]
s.extend(list(s1))
s.extend(list(s2))
s.extend(list(s3))
s.extend(list(s4))
random.shuffle(s)
password = s[0:num]
l4=Label(root, text="Password: ",font="time 15 bold")
l4.place(x=30,y=250)
l5=Label(root, text=password,font="time 15 bold",bg="grey", width=24)
l5.place(x=150,y=250)
l1 = Label(root, text="PASSWORD GENERATOR",font="time 15 bold")
l1.place(x=30,y=30)
l2 = Label(root, text="Enter Password Length: ",font="time 15 bold")
l2.place(x=30,y=90)
e1=Entry(root, width=46, bd=2, font="time 13 bold")
e1.place(x=30, y=133)
button = Button(root, text="Generate Password", fg="white" , bg="#0077b6", font="time 15 bold" , width=34, command=gen )
button.place(x=30,y=180)
root.mainloop()