python3.5学习之路_day1_用户登录

A-微商贸,小凡

A-微商贸,小凡

发表于 2017-01-11 21:00:45
内容来源: 网络
 1 #!/usr/bin/env python
 2 #_*_coding:utf-8_*_
 3 #by anthor zhangxiaoyu 2017-01-10
 4 #blog:http://www.cnblogs.com/gushiren/
 5 
 6 import getpass
 7 username = "zhangxiaoyu"
 8 password = "www.123"
 9 count = 3
10 for i in range(3):
11         username = raw_input("33[32mPlease enter your username:33[0m")
12         password = getpass.getpass("33[32mPlease enter your password:33[0m")
13         if username == "zhangxiaoyu" and password == "www.123":
14                 print "33[33mlogin success,welcome %s login to system!33[0m" % username
15                 break
16         else:
17                 count -= 1
18                 print "Please type right user or password %s " % count

 

内容来源:http://www.cnblogs.com/gushiren/p/6274414.html

用户评论
开源开发学习小组列表