-
Notifications
You must be signed in to change notification settings - Fork 0
/
ran.py
27 lines (21 loc) · 812 Bytes
/
ran.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
#coder: Venkateshu Dudyala
#don't copy other's code without consent
from tkinter import *
from tkinter import ttk
import random,string
def generate():
password.set(''.join(random.choices(data,k = int(n.get()))))
window = Tk()
n = StringVar()
password = StringVar()
data = '!#$%^&*()_' + string.ascii_letters + string.digits
ttk.Label(window, text = "Length :", ).grid(
column = 0, row = 0, pady = 10)
combo = ttk.Combobox(window, width = 4, textvariable = n)
combo['values'] = [i for i in range(6,21)]
combo.grid(column = 1, row = 0,pady = 10)
ttk.Button(window,text = "generate",command = generate).grid(
row = 0,column = 2,pady = 10,padx = 5)
ttk.Entry(window,textvariable = password).grid(
row = 0,column = 3,padx = 5,pady = 10)
window.mainloop()