We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5b857a commit 6133e81Copy full SHA for 6133e81
passwdmanager.exe
30.7 KB
passwdmanager.py
@@ -20,7 +20,20 @@ def enter():
20
enter.user = input("Enter database username: ")
21
enter.passwd = getpass.getpass("Enter database password: ")
22
enter.k = getpass.getpass("Enter master password: ")
23
- func()
+ test_login()
24
+
25
+def test_login():
26
+ try:
27
+ #connect to database
28
+ mydb = mysql.connector.connect(
29
+ host='localhost', #or your hostname/ip-address
30
+ user=(enter.user),
31
+ password=(enter.passwd)
32
+ )
33
+ func()
34
+ except mysql.connector.Error as err:
35
+ print("\033[1;31;40m Error username or password.Plese try again\033[1;37;40m\n")
36
+ enter()
37
38
def func():
39
if enter.user=='' or enter.passwd=='' or enter.k=='': #detect blank input
0 commit comments