File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
import tkinter as tk
2
2
from tkinter import messagebox
3
3
4
+
4
5
def check_password (password ):
5
6
with open ("pwd.txt" , "r" ) as file :
6
7
common_passwords = file .read ().splitlines ()
7
8
8
9
for i , common_pwd in enumerate (common_passwords , start = 1 ):
9
10
if password == common_pwd :
10
- messagebox .showinfo ("Password Check" , f"{ password } : not unique (#{ i } )" )
11
+ messagebox .showinfo (
12
+ "Password Check" , f"{ password } : not unique (#{ i } )" )
11
13
return
12
14
13
15
messagebox .showinfo ("Password Check" , f"{ password } : unique" )
14
16
17
+
15
18
def main ():
16
19
app = tk .Tk ()
17
20
app .title ("Password Checker" )
@@ -23,10 +26,12 @@ def main():
23
26
password_entry = tk .Entry (app , show = "*" )
24
27
password_entry .pack ()
25
28
26
- check_button = tk .Button (app , text = "Check" , command = lambda : check_password (password_entry .get ()))
29
+ check_button = tk .Button (
30
+ app , text = "Check" , command = lambda : check_password (password_entry .get ()))
27
31
check_button .pack ()
28
32
29
33
app .mainloop ()
30
34
35
+
31
36
if __name__ == "__main__" :
32
37
main ()
You can’t perform that action at this time.
0 commit comments