-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPassword-app.py
More file actions
53 lines (34 loc) · 1.46 KB
/
Password-app.py
File metadata and controls
53 lines (34 loc) · 1.46 KB
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
import string
import random
from tkinter import*
def generate():
s1 = string.ascii_lowercase
s2 = string.ascii_uppercase
s3 = string.punctuation
s4 = string.digits
password_data = []
password_data.extend(list(s1))
password_data.extend(list(s2))
password_data.extend(list(s3))
password_data.extend(list(s4))
random.shuffle(password_data)
a = len_pass.get()
passgen = ("".join(password_data[0:a]))
random.shuffle(password_data)
passleb = Label(window, text = "Password:").grid(row = 7, column = 0)
pass_disply = Entry(window, text = passgen)
pass_disply.insert(0, passgen)
pass_disply.grid(row = 8, column = 0)
passle = Label(window, text = passgen).grid(row = 9, column = 0)
window = Tk()
window.title("Password Generation")
window .geometry("400x400")
window.resizable(width = False, height = False)
head_label = Label(window, text = "Welcome").grid(row = 1, column = 0)
content_label = Label(window, text = "This application is used to generate password").grid(row = 2, column = 0)
password_length = Label(window, text = "Enter Lenght of Password").grid(row = 3, column = 0)
len_pass = IntVar()
pass_len_user = Entry(window, textvariable = len_pass).grid(row = 4, column = 0)
generate_button = Button(window, text = "Generate", command = generate, width = 20).grid(row = 5, column = 1)
close_button = Button(window, text = "Close", command = quit, width = 20).grid(row = 6, column = 1)
window.mainloop()