Python 編寫使用者登入介面

來源:互聯網
上載者:User

標籤:python

附有流程圖可以看一看,第一次畫會慢慢改進的。

代碼如下:

1.User    使用者名稱隱藏檔

王二  123張三    1234李四    123456


2.Lock_User    被鎖使用者檔案



3. Land.py    主程式檔案


sysi=i<:    ()    account = ()  /使用者賬戶輸入    Lock_list = (,)           /開啟加鎖檔案(讀寫方式)    Lock_user = Lock_list.readlines()         /將擷取的資訊提取到list中    User_list = ()    User = User_list.readlines()    Lock_line Lock_user:        Lock_line = Lock_line.strip()     /去掉\n符,提取出可用資訊        account == Lock_line:            sys.exit(% account)    User_account User:                /分別提取使用者名稱,密碼        (User,Password) = User_account.strip().split()        account == User:                    /帳號匹配迴圈            j = j < :                passwd = ()                (passwd) == Password:                    (% account)                    sys.exit()                :                    j!=:                       (%(account,-j))                    j = j+:                Lock_list.write(account + )  /密碼匹配失敗,鎖定帳號                sys.exit(% account)        :                          /帳號不存在先pass,超出三次退出系統          :        i!=:            (%(account,-i))    i +=:    sys.exit(% account )Lock_list.close()User_list.close()


Python 編寫使用者登入介面

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.