溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

python實(shí)現(xiàn)二級(jí)登陸菜單及安裝過程

發(fā)布時(shí)間:2020-10-03 14:04:50 來源:腳本之家 閱讀:151 作者:mrr 欄目:開發(fā)技術(shù)

python實(shí)現(xiàn)二級(jí)登陸菜單的代碼如下所示:

"""
 1.三級(jí)菜單 注冊(cè) 登陸 注銷
 2.進(jìn)入每一個(gè)一級(jí)菜單,都會(huì)有下一級(jí)的菜單
"""
user_item = dict()
try:
  while True:
    print('-------Welcome sir-------')
    input_choice = int(input('Please enter your choice:1:Registration 2:login 3:logout:'))
    # 用戶輸入自己的選擇,會(huì)進(jìn)入到相關(guān)的二級(jí)菜單
    if input_choice == 1:
      # if input_choice==1 進(jìn)入注冊(cè)
      user = input('Please enter your account number:')
      pwd = input('please enter your password:')
      # 保存用戶注冊(cè)的賬號(hào)
      user_item['user'] = user
      user_item['pwd'] = pwd
      # 提示用戶注冊(cè)成功
      print('您的賬號(hào)已生效,下次請(qǐng)用該賬號(hào):{}登陸本系統(tǒng)'.format(user))
    # if input_choice==2 進(jìn)入登陸
    elif input_choice == 2:
      login_user = input('Please enter your login account number:')
      login_pwd = input('please enter your login password:')
      # 對(duì)用戶輸入的賬號(hào)和密碼進(jìn)行確認(rèn)
      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 進(jìn)入注銷
    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.安裝過程(自動(dòng)添加安裝路徑):

python實(shí)現(xiàn)二級(jí)登陸菜單及安裝過程python實(shí)現(xiàn)二級(jí)登陸菜單及安裝過程python實(shí)現(xiàn)二級(jí)登陸菜單及安裝過程

4.手工添加路徑:

a.【右鍵計(jì)算機(jī)】-->【屬性】-->【高級(jí)系統(tǒng)設(shè)置】-->【高級(jí)】-->【環(huán)境變量】:
b.【在第二個(gè)內(nèi)容框中(系統(tǒng)變量)找到 變量名為Path 的一行,雙擊】 --> 【把Python安裝目錄追加到其中,用英文下的分號(hào)(;)分割,切記前面有分號(hào)】

5.查看是否安裝成功:

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

python實(shí)現(xiàn)二級(jí)登陸菜單及安裝過程

總結(jié)

以上所述是小編給大家介紹的python實(shí)現(xiàn)二級(jí)登陸菜單及安裝過程,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)億速云網(wǎng)站的支持!
如果你覺得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI