python實(shí)現(xiàn)二級登陸菜單及安裝過程
python實(shí)現(xiàn)二級登陸菜單的代碼如下所示:
"""
1.三級菜單 注冊 登陸 注銷
2.進(jìn)入每一個一級菜單,都會有下一級的菜單
"""
user_item = dict()
try:
while True:
print('-------Welcome sir-------')
input_choice = int(input('Please enter your choice:1:Registration 2:login 3:logout:'))
# 用戶輸入自己的選擇,會進(jìn)入到相關(guān)的二級菜單
if input_choice == 1:
# if input_choice==1 進(jìn)入注冊
user = input('Please enter your account number:')
pwd = input('please enter your password:')
# 保存用戶注冊的賬號
user_item['user'] = user
user_item['pwd'] = pwd
# 提示用戶注冊成功
print('您的賬號已生效,下次請用該賬號:{}登陸本系統(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:')
# 對用戶輸入的賬號和密碼進(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.安裝過程(自動添加安裝路徑):



4.手工添加路徑:
a.【右鍵計(jì)算機(jī)】-->【屬性】-->【高級系統(tǒng)設(shè)置】-->【高級】-->【環(huán)境變量】:
b.【在第二個內(nèi)容框中(系統(tǒng)變量)找到 變量名為Path 的一行,雙擊】 --> 【把Python安裝目錄追加到其中,用英文下的分號(;)分割,切記前面有分號】
5.查看是否安裝成功:
Windows下,開始(快捷鍵:Windows+R)-cmd,輸入命令:python

總結(jié)
以上所述是小編給大家介紹的python實(shí)現(xiàn)二級登陸菜單及安裝過程,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
如果你覺得本文對你有幫助,歡迎轉(zhuǎn)載,煩請注明出處,謝謝!
- Python三級菜單的實(shí)例
- Python字典實(shí)現(xiàn)簡單的三級菜單(實(shí)例講解)
- python實(shí)現(xiàn)應(yīng)用程序在右鍵菜單中添加打開方式功能
- 使用python實(shí)現(xiàn)省市三級菜單效果
- Python實(shí)現(xiàn)微信公眾平臺自定義菜單實(shí)例
- python之wxPython菜單使用詳解
- python查看模塊安裝位置的方法
- 在python中安裝basemap的教程
- win10下python3.5.2和tensorflow安裝環(huán)境搭建教程
- python3.6.3安裝圖文教程 TensorFlow安裝配置方法
- centos6.8安裝python3.7無法import _ssl的解決方法
- python 3.7.0 安裝配置方法圖文教程
- python 3.7.0 下pillow安裝方法
- python3.7.0的安裝步驟
Python import與from import使用和區(qū)別解讀
使用matplotlib創(chuàng)建Gif動圖的實(shí)現(xiàn)
python獲取異常信息exc_info和print_exc的使用
Python多進(jìn)程同步簡單實(shí)現(xiàn)代碼
Python利用第三方模塊實(shí)現(xiàn)壓縮css文件
Python中標(biāo)準(zhǔn)庫OS的常用方法總結(jié)大全

