issues with an assignment
I need help with an assignment containing Tkinter. the instructions are
1. Create a repl.it tkinter program. Copy your code from your first login program.
- Create a dictionary that stores usernames and passwords as follows:
users = { "theatrechick25" : "2Bornot2B", "soccerGuy2024" : "getYourKick$"}
Comment out the command that added the "hidden" label to the grid. You'll want to use this later!
Now create a function login() that:
stores the values of the username and password entries as variables
checks to see if a username is in the users dictionary (you can do this with the in command)
if it is, check to see if the password matches the password in the dictionary
If the username or password is incorrect, change the text of the hidden label to "Invalid username or password" and add it to the grid at its previous location
If the username and password are both valid:
change the text of the hidden label to "Login Successful" and add it to the grid at its previous location
hide the "invalid username or password" label with __.get_forget()
5. On the login button, change the value of the command to be login, so that when this button is pressed, it calls login().
i got the majority of this done but have ran into a wall. can someone help me
google is your friend
i tried google. i am getting an issue with the line 10. i get an attribute error no matter what I do @Axrevyn
@AustinMoore4 Ah, that error.
.get()
is only used for lists, whileusername
is a string, so it throws an error.