Day01 login module
知识点:模块导入 变量赋值的两种形式 格式化输出 for循环 if...else 嵌套
#!C:\Program Files\Python35/bin
# -*- conding:utf-8 -*-
# author: Frank
import getpass
user,passwd= 'Frank','oldboy_python'
msg = '''
Information of %s person:
NAME: %s
AGE: %s
JOB: %s
ID : %s
''' %(user,user, 21, 'IT Engineer',3714)
input_time = 1
for i in range(5):
print("-----input %d time-----" %int((input_time)))
username = input("please input your name:")
# password = getpass.getpass("please input your password:")
password = input("please input your password:")
if username == user and password == passwd :
print("%s Welcom to login on" %(user))
info_confirm = input("If you need double check your personal inform yes/no:")
if info_confirm == 'yes':
print(msg)
break
else:
print("please go ahead")
break
else :
if input_time == 3:
print("Your input has 3 times wrong , your account will be locked")
exit()
else:
print("Your user or password is invalid , pleasre re_input!")
input_time += 1
测试结果:
#测试1
-----input 1 time-----
please input your name:frank
please input your password:dmfkdf
Your user or password is invalid , pleasre re_input!
-----input 2 time-----
please input your name:frank
please input your password:kdf
Your user or password is invalid , pleasre re_input!
-----input 3 time-----
please input your name:Frkdfk
please input your password:msk
Your input has 3 times wrong , your account will be locked #测试2
-----input 1 time-----
please input your name:Frank
please input your password:oldboy_python
Frank Welcom to login on
If you need double check your personal inform yes/no:yes Information of Frank person:
NAME: Frank
AGE: 21
JOB: IT Engineer
ID : 3714 # 测试3:
-----input 1 time-----
please input your name:frak
please input your password:mksf34
Your user or password is invalid , pleasre re_input!
-----input 2 time-----
please input your name:mddif
please input your password:frank3235
Your user or password is invalid , pleasre re_input!
-----input 3 time-----
please input your name:Frank
please input your password:oldboy_python
Frank Welcom to login on
If you need double check your personal inform yes/no:no
please go ahead
Day01 login module的更多相关文章
- Centos6.5 登录时,提示Module is unkown
前一段时间,因工作需要在物理机上装了一个Centos6.5,但是,用了一段时间,发现再登录时,无论如何也登不进去了,并且也不提示用户名或者密码错误.我一度以为是在profile以及.bashrc或者. ...
- [Vuex] Lazy Load a Vuex Module at Runtime using TypeScript
Sometimes we need to create modules at runtime, for example depending on a condition. We could even ...
- [Firebase] 3. Firebase Simple Login Form
Using $firebaseSimpleLogin service. Here we use three methods for login, logout, register and getCur ...
- js中的预加载与懒加载(延迟加载)
js中加载分两种:预加载与延迟加载 一. 预加载,增强用户的体验,但会加载服务器的负担.一般会使用多种 CSS(background).JS(Image).HTML(<img />) . ...
- Nodejs学习笔记(七)--- Node.js + Express 构建网站简单示例
目录 前言 新建项目.建立数据库以及其它准备工作 新建express + ejs 项目:sampleEjs 创建数据库 修改package.json文件,安装session和mysql模块 样式和JQ ...
- Spring学习笔记之整合struts
1.现有项目是通过 <action path="/aaaaAction" type="org.springframework.w ...
- IOS使用APNS推送Payload字节数限制导致推送不成功
这2天须要在推送上加上脚本,找到了badge方法能够加脚本.加上后可是怎么推送也不成功.郁闷了好久.在网上查找相关资料. 最终被我找到原因: "Payload--最多256bytes. &q ...
- Angular 2.0 从0到1 (七)
第一节:Angular 2.0 从0到1 (一)第二节:Angular 2.0 从0到1 (二)第三节:Angular 2.0 从0到1 (三)第四节:Angular 2.0 从0到1 (四)第五节: ...
- ActiveMQ(5.10.0) - Configuring the JAAS Authentication Plug-in
JAAS provides pluggable authentication, which means ActiveMQ will use the same authentication API re ...
随机推荐
- Java 教程整理:基础、项目全都有
Java 在编程语言排行榜中一直位列前排,可知 Java 语言的受欢迎程度了. 网上有很多 Java 教程,无论是基础入门还是开发小项目的教程都比比皆是,可是系统的很少,对于Java 学习者来说找到系 ...
- 在MySQL数据库中创建一个完整的表
1.登陆成功后,首先进入某一个数据库 (不是指数据库服务器) use t1; //t1是数据库名 如图所示: 2.在此数据库中建立数据库表 2.1 先建立表结构(可以理解为表的列名,也就是字段名)在实 ...
- FineReport如何部署Tomcat服务器集群
环境准备 Tomcat服务器集群中需要进行环境准备: Apache:Apache是http服务器,利用其对Tomcat进行负载均衡,这里使用的版本是Apache HTTP Server2.0.64: ...
- angularJS(5)
angularJS(5) 一,数据循环:特别要注意作用域 使用ng-repeat指令. <div ng-app="myApp" ng-controller="myC ...
- Linux配置防火墙 开启80端口的方法
命令行输入: vi /etc/sysconfig/iptables 将 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT ...
- ASP.NET Aries DataGrid 配置表头说明文档
DataGrid 配置表头 字段 中文 说明 Field 字段 注意:mg_ 开头的字段为层级表头 Title 列称 OrderNum 序号 显示的顺序(冻结和非冻结列是两个组的序号) Width 列 ...
- K-Means 聚类算法
K-Means 概念定义: K-Means 是一种基于距离的排他的聚类划分方法. 上面的 K-Means 描述中包含了几个概念: 聚类(Clustering):K-Means 是一种聚类分析(Clus ...
- Linux 中优秀的文本化编辑思想大碰撞(Markdown、LaTeX、MathJax)
这样一个标题可能不太准确,因为确实无法准确地解释什么叫"文本化编辑思想".其实我这篇随笔主要是想探讨 Markdown.LaTeX.MathJax,有兴趣的朋友可以继续往下看,同时 ...
- [ 技术人员创业Tips ] 1:抓住优质客户(上)
写一篇技术以外的内容,可能会得罪一些人,轻拍,此外本文写的比较随意,写到哪里算哪里,轻拍. IT业不知道从什么时候起特别流行谈创业,似乎不谈创业就落伍,我不评价这种风气的好坏,只提一些自己的一些经验和 ...
- Linux环境下shell和vim中乱码原因及消除办法
shell和vim中乱码原因及消除办法 作者:Jack47 在Linux下开发,经常遇到乱码问题:shell或者vim中显示不了中文,或者能够显示,但不能输入中文.每次都是上网去搜,或者同事告诉我一些 ...