def input_():
username = raw_input("Username:")
password = getpass.getpass("Password:")
choose = username,password
if '' in choose:
print 'Username or password is empty!'
input_()
else:
return username,password
username,password = input_()
print username,password
这个程序跑不起来,如果输入不为空,可以print。如果先输入空,再不输入空,就不行了。。。报错
求解 |