簡単なログインスクリプト
707 ワード
#!/usr/bin/python
whileTrue:
input = raw_input("pelease inputyour name:")
if input == 'leo':
password =raw_input("pelease input your password:")
p = '123'
while password != p:
password =raw_input("Wrong password,input again:")
else:
print "welcome loginon"
break
else:
print "sorry,user %s notfind" % input
[root@localhost script]# python while2.py
pelease input your name:leo
pelease input your password:123
welcome login on