-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom-pass-genv3.py
72 lines (63 loc) · 2.04 KB
/
random-pass-genv3.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
from tkinter import *
import tkinter.font as tkFont
import random
root = Tk()
def GButton_998_command():
tam = lol.get()
caracter = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&*(){}[]/\?!@#$abcdefghijklmnopqrstuvwxyz"
contra = "".join(random.sample(caracter, tam))
with open('passwords.txt', 'w') as passwords:
passwords.write(contra)
passwords.close()
GLabel_565=Label(root)
GLabel_565["bg"] = "#000000"
ft = tkFont.Font(family='Times',size=10)
GLabel_565["font"] = ft
GLabel_565["fg"] = "#00ff00"
GLabel_565["justify"] = "center"
GLabel_565["text"] = contra
GLabel_565.place(x=60,y=210,width=240,height=60)
#setting title
root.title("Password Generator")
#setting window size
width=366
height=381
screenwidth = root.winfo_screenwidth()
screenheight = root.winfo_screenheight()
alignstr = '%dx%d+%d+%d' % (width, height, (screenwidth - width) / 2, (screenheight - height) / 2)
root.geometry(alignstr)
root.resizable(width=False, height=False)
GLabel_352=Label()
GLabel_352["bg"] = "#000000"
ft = tkFont.Font(family='Times',size=10)
GLabel_352["font"] = ft
GLabel_352["fg"] = "#e60808"
GLabel_352["justify"] = "center"
GLabel_352["text"] = ""
GLabel_352.place(x=0,y=0,width=366,height=381)
lol = IntVar()
en=Entry(textvariable=lol)
en.place(x=60,y=80,width=230,height=46)
en["fg"] = "#333333"
en["borderwidth"] = "1px"
en["justify"] = "center"
ft = tkFont.Font(family='Times',size=10)
en["font"] = ft
GLabel_612=Label(root)
ft = tkFont.Font(family='Times',size=11)
GLabel_612["font"] = ft
GLabel_612["bg"] = "#000000"
GLabel_612["fg"] = "#ff0000"
GLabel_612["justify"] = "center"
GLabel_612["text"] = "Password lenght (Maximum 77):"
GLabel_612.place(x=80,y=40,width=190,height=30)
GButton_998=Button(root)
GButton_998["bg"] = "#f0f0f0"
ft = tkFont.Font(family='Times',size=12)
GButton_998["font"] = ft
GButton_998["fg"] = "#000000"
GButton_998["justify"] = "center"
GButton_998["text"] = "Generate password"
GButton_998.place(x=110,y=140,width=144,height=37)
GButton_998["command"] = GButton_998_command
root.mainloop()