python二级登陆菜单
"""
1.三级菜单 注册 登陆 注销
2.进入每一个一级菜单,都会有下一级的菜单 """
user_item = dict()
try:
while True:
print('-------Welcome sir-------')
input_choice = int(input('Please enter your choice:1:Registration 2:login 3:logout:'))
# 用户输入自己的选择,会进入到相关的二级菜单
if input_choice == 1:
# if input_choice==1 进入注册
user = input('Please enter your account number:')
pwd = input('please enter your password:') # 保存用户注册的账号
user_item['user'] = user
user_item['pwd'] = pwd
# 提示用户注册成功
print('您的账号已生效,下次请用该账号:{}登陆本系统'.format(user)) # if input_choice==2 进入登陆
elif input_choice == 2:
login_user = input('Please enter your login account number:')
login_pwd = input('please enter your login password:') # 对用户输入的账号和密码进行确认
if login_user == user_item['user'] and login_pwd == user_item['pwd']:
print('Welcome sir:{}'.format(login_user))
else:
print('Sorry, your account or password is incorrect. Please confirm and come back')
# if input_choice == 3 进入注销
elif input_choice == 3:
logout_input = input('Do you really want to quit this system?,y or n')
if logout_input == 'y':
break
elif logout_input == 'n':
input_choice = int(input('Please enter your choice:1:Registration 2:login 3:logout:'))
else:
print('Your input is incorrect')
except Exception as re:
print(re)
finally:
print('')
python二级登陆菜单的更多相关文章
- python之三级菜单
		
python之三级菜单 要求: 1. 运行程序输出第一级菜单 2. 选择一级菜单某项,输出二级菜单,同理输出三级菜单 3. 菜单数据保存在文件中 4. 让用户选择是否要退出 5. 有返回上一级菜单的功 ...
 - Python模拟登陆新浪微博
		
上篇介绍了新浪微博的登陆过程,这节使用Python编写一个模拟登陆的程序.讲解与程序如下: 1.主函数(WeiboMain.py): import urllib2 import cookielib i ...
 - python打怪之路【第三篇】:利用Python实现三级菜单
		
程序: 利用Python实现三级菜单 要求: 打印省.市.县三级菜单 可返回上一级 可随时退出程序 coding: menu = { '北京':{ '朝阳':{ '国贸':{ 'CICC':{}, ' ...
 - Magento添加一个下拉登陆菜单Create Magento Dropdown Login in a few minutes
		
Dropdown login forms are not a feature many online stores use, but in some cases they could be quite ...
 - 一款jquery编写图文下拉二级导航菜单特效
		
一款jquery编写图文下拉二级导航菜单特效,效果非常简洁大气,很不错的一款jquery导航菜单特效. 这款jquery特效适用于很多的个人和门户网站. 适用浏览器:IE8.360.FireFox.C ...
 - Ajax实现动态的二级级联菜单
		
今天花了点时间用Ajax实现了一个二级级联菜单.整理总结一下.为了把重点放在Ajax和级联菜单的实现上,本文省略了数据库建表语句和操作数据库的代码! 数据库建表语句就不帖出来了.主要有两张表,区域表: ...
 - jQuery制作右侧边垂直二级导航菜单
		
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
 - 纯CSS二级纵向菜单
		
纯CSS二级纵向菜单 <body> <div class="divda"> <div class="nav"> <ul ...
 - Python模拟登陆万能法-微博|知乎
		
Python模拟登陆让不少人伤透脑筋,今天奉上一种万能登陆方法.你无须精通HTML,甚至也无须精通Python,但却能让你成功的进行模拟登陆.本文讲的是登陆所有网站的一种方法,并不局限于微博与知乎,仅 ...
 
随机推荐
- python 用PIL Matplotlib处理图像的基本操作
			
在 python 中除了用 opencv,也可以用 matplotlib 和 PIL 这两个库操作图片.本人偏爱 matpoltlib,因为它的语法更像 matlab. 一.matplotlib 1. ...
 - string.Format 格式化日期格式
			
DateTime dt = DateTime.Now;//2010年10月4日 17点05分 string str = ""; //st ...
 - java异常处理的面试题
			
package test; public class Test { public static int method(int i) throws Exception { try { return 10 ...
 - Spring Cloud-hystrix(六)
			
作用 防止 多个服务相互交互时某个服务运行缓慢导致调用方线程挂起,高并发情况下 导致挂起线太多 引起调用方的服务不可用 能够在服务发生故障或者通过断路器监控向调用方返回一个错误 而不是长时间的等待 S ...
 - ExtJs之gridPanel的属性表格,编辑表格,表格分页,分组等技巧
			
这里藏的配置确实多.. 慢慢实践吧. <!DOCTYPE html> <html> <head> <title>ExtJs</title> ...
 - 哈哈,找到一种方式来简单模拟EXTJS中与服务器的AJAX交互啦。
			
一直在测试客户端的EXTJS,但遇到服务器端就麻烦了,要建库,要写JSON,要有HTTP返回值. 今天测试了一个简单的方法,经过测试是OK了. 那,就是Python的SimpleHTTPServer模 ...
 - Tomcat日志配置远程Syslog采集
			
http://blog.csdn.net/leizi191110211/article/details/51593748
 - POJ 2374
			
挺水的一道线段树+DP题.可以从底往上添加线段,每添加线段之前查询端点所被覆盖的区间线段.再从最顶往下DP,每次从端点出发,递推覆盖该端点的区间线段的两端的值即可. #include <cstd ...
 - 关于在linux下出现stdio.h文件不存在等gcc标准库不能找到的解决的方法
			
首先说明一下我的系统配置:ubuntu 12.04 gcc 4.6.3 有几天没有使用ubuntu了,今天拿出来编程序,刚開始编译一个uboot1.1.6的代码.出现了stdio.h:没有那么 ...
 - 基于DPI(深度报文解析)的应用识别2------实际分析
			
新浪微博的分析 早上刚刚起床先刷微博,打算就分析一下新浪微博.登陆之后抓取公布微博的数据包.进行分析. 1.抓包的要点: 1.关闭其它网络应用,保证本机网络流量的干净,便于分析. 2.先开启wires ...