-2
所以我目前正在創建一個需要真正基本認證的測驗程序。這是我的僞碼。檢查用戶輸入的.txt文件(Python 2.7.11)
Start
Open UserCredentials.txt (This is where the user ID is stored)
Get UserID
If UserID is in UserCredetials.txt(This is the part that i could not figure out how to do)
..Passtries = 0
..While passtries != 1
....Get password
....If password is UserCredentials.txt(The other part which i couldnt do.)
......Passtries = 1 (Correct password, it will exit the loop)
....else
......Passtries = 0 (wrong password, it will continue looping)
....WhileEnd
所以這裏的問題是,我無法弄清楚如何檢查基礎上,UserCredentials.txt文件什麼用戶輸入並在Python編寫代碼了。 (Python的2.7.11)
注意,在UserCredentials.txt,用戶ID和密碼由側方存儲[Izzaz ABC123]
而且我仍然過一種新蟒蛇,這樣下去容易在我身上:)
任何幫助表示讚賞。
取看看['raw_input()'](https://docs.python.org/2/library/functions.html#raw_input) – JazZ