Hi, all.
I am having a problem using the getpass()
function, there are no problems with the raw_input()
, though.
I'm trying to check the user input is valid (meaning that the Username is nav and the password is 39429432)
Really, I DON'T want to use raw_input()
for the password field.
def login():
import getpass
userpass = "39429432" = "nav";
usr = raw_input('Username: ')
psswd = getpass.getpass(["prompt"["stream"]])
if usr==usernm and psswd==userpass:
main()
else:
SystemExit()
This code is....is....failing D:
Here's the error:
Traceback (most recent call last):
File "C:\Users\Navid_2\Desktop\NavS.py", line 5, in login
psswd = getpass.getpass(["prompt"["stream"]])
TypeError: string indices must be integers, not str