python實(shí)現(xiàn)二級(jí)登陸菜單及安裝過(guò)程
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 安裝過(guò)程。
Python安裝
Windows:
1.下載地址:https:
/
/
www.python.org
/
downloads
/
2.百度云盤分享地址:
鏈接:https://pan.baidu.com/s/1FJ0fXs6mIBm342AJ4ZXNhw
提取碼:768z
3.安裝過(guò)程(自動(dòng)添加安裝路徑):
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下,開(kāi)始(快捷鍵:Windows+R)-cmd,輸入命令:python
總結(jié)
以上所述是小編給大家介紹的python實(shí)現(xiàn)二級(jí)登陸菜單及安裝過(guò)程,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺(jué)得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!
- Python三級(jí)菜單的實(shí)例
- Python字典實(shí)現(xiàn)簡(jiǎn)單的三級(jí)菜單(實(shí)例講解)
- python實(shí)現(xiàn)應(yīng)用程序在右鍵菜單中添加打開(kāi)方式功能
- 使用python實(shí)現(xiàn)省市三級(jí)菜單效果
- Python實(shí)現(xiàn)微信公眾平臺(tái)自定義菜單實(shí)例
- python之wxPython菜單使用詳解
- python查看模塊安裝位置的方法
- 在python中安裝basemap的教程
- win10下python3.5.2和tensorflow安裝環(huán)境搭建教程
- python3.6.3安裝圖文教程 TensorFlow安裝配置方法
- centos6.8安裝python3.7無(wú)法import _ssl的解決方法
- python 3.7.0 安裝配置方法圖文教程
- python 3.7.0 下pillow安裝方法
- python3.7.0的安裝步驟

Python import與from import使用和區(qū)別解讀

使用matplotlib創(chuàng)建Gif動(dòng)圖的實(shí)現(xiàn)

python獲取異常信息exc_info和print_exc的使用

Python多進(jìn)程同步簡(jiǎn)單實(shí)現(xiàn)代碼

Python利用第三方模塊實(shí)現(xiàn)壓縮css文件

Python中標(biāo)準(zhǔn)庫(kù)OS的常用方法總結(jié)大全