Checking a .txt file for an input by the user (Python 2.7.11)
<p>So i am currently creating a quiz program which requires a really basic authentication. This is the psuedocode that i have.</p>

<pre><code>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
</code></pre>

<p>So the problem here is that i could not figure out how to check the UserCredentials.txt file based on what the user has inputted and write the code for it in python. (Python 2.7.11)   </p>

<p>Note that in the UserCredentials.txt, the userID and password are stored side by side [Izzaz abc123]    </p>

<p>Also i am still kind off new to python, so go easy on me :)<br>
Any help is appreciated.</p>

<p>.you should start to use dict for data container and xml or json for the formatting</p>

<pre><code>UserCredentials.xml

members_dict:
    User(Name = "izzaz", Passwort: "abc123")
    User(Name = "isssz", Passwort: "asassa")

.start
.open UserCredentials.xml/json
.get members_users
.if user_id_input in members_users continue 
.if user_passwort_input == members[user_id_input][passwort]:
</code></pre>

<p>its only a guide how it can work, more information about <a href="https://docs.python.org/2/library/collections.html" rel="nofollow">OrderedDict</a>, <a href="https://docs.python.org/2/library/xml.etree.elementtree.html" rel="nofollow">Xml Parsing</a>, 
<a href="http://stackoverflow.com/questions/3605680/creating-a-simple-xml-file-using-python">create simple Xml file</a></p>

python