资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

python实现二级登陆菜单及安装过程-创新互联

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实现二级登陆菜单及安装过程-创新互联
网页网址:http://cdkjz.cn/article/ighgs.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220