We are going to learn:
Download the Medialib ex9 code files and 5 image files (as shown below) from the gallery and complete the program in ex9.py.
With a dictionary that have usernames as keys and passwords as values, which is like login_dict={“taro”: “1234”, “hanako”: ”asdf”, ...}
, create a user login program that loops the following processes until the user successfully logged in.
“Username: ”
to get the username. “password.png”
and use input() function with a prompt “Password: ”
to get the password. If the password is correct, print ”Login succeeded!"
, and display “welcome.png”
, then finish the program.
Otherwise, print “Password is incorrect!
, display “wrong_password.png”
and wait for a mouse left click to go to 1. again.
“No such user!”
, and display “wrong_user.png”
, then wait for a mouse left click to go to 1. again