python實現二級登陸菜單及安裝過程

這篇文章主要介紹了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 安裝過程。

Python安裝

Windows:

1.下載地址:https://www.python.org/downloads/

2.百度雲盤分享地址:

鏈接:https://pan.baidu.com/s/1FJ0fXs6mIBm342AJ4ZXNhw
提取碼:768z

3.安裝過程(自動添加安裝路徑):

4.手工添加路徑:

a.【右鍵計算機】-->【屬性】-->【高級系統設置】-->【高級】-->【環境變量】:
b.【在第二個內容框中(系統變量)找到 變量名爲Path 的一行,雙擊】 --> 【把Python安裝目錄追加到其中,用英文下的分號(;)分割,切記前面有分號】

5.查看是否安裝成功:

 Windows下,開始(快捷鍵:Windows+R)-cmd,輸入命令:python 

總結

以上所述是小編給大家介紹的python實現二級登陸菜單及安裝過程,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回覆大家的。在此也非常感謝大家對神馬文庫網站的支持!
如果你覺得本文對你有幫助,歡迎轉載,煩請註明出處,謝謝!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章