And please, please, post the whole error message, as it specifies where the error occurred.<br>
<br>
Oh, yes, and I think I answered this - <br>
<br>
&quot;<br>
I meant to ask why the main part after the password is not working right.<br>
No one has answered that yet. When I run the code and try to load a file<br>
that has been saved, a TypeError appears.<br>
&quot;<br>
<br>
Try id[site] and passcard[site] not id(site) and passcard(site). It'll make a world of difference, honest.<br><br><div><span class="gmail_quote">On 7/7/05, <b class="gmail_sendername">Danny Yoo</b> &lt;<a href="mailto:dyoo@hkn.eecs.berkeley.edu">
dyoo@hkn.eecs.berkeley.edu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi Nathan,<br><br>Other folks are pointing out why you're getting certain error messages.
<br>You may also want to consider breaking up the long second-half of the<br>program into into its own set of functions.&nbsp;&nbsp;I believe that the second<br>half could look something like this:<br><br>######<br>while menu_choice != 9:
<br>&nbsp;&nbsp;&nbsp;&nbsp;menu_choice = input(&quot;Choose an option:&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;if menu_choice == 1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;add_login_command()<br>&nbsp;&nbsp;&nbsp;&nbsp;elif menu_choice == 2:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lookup_login_command()<br>&nbsp;&nbsp;&nbsp;&nbsp;elif menu_choice == 3:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;remove_login_command()
<br>&nbsp;&nbsp;&nbsp;&nbsp;elif menu_choice == 4:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display_login_command()<br>&nbsp;&nbsp;&nbsp;&nbsp;elif menu_choice == 5:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;save_login_command()<br>&nbsp;&nbsp;&nbsp;&nbsp;elif menu_choice == 6:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;load_login_command()<br>######<br><br>The idea behind the break-up here is to make it a little easier to see, at
<br>a high level, how the program works.&nbsp;&nbsp;As a side benefit, it should help to<br>avoid wacky things like certain menu choices munging up the variables used<br>by other menu choices.<br><br>Finally, by physcially shortening that loop, it's easier to see that we'll
<br>always ask for a menu_choice whenever we hit the start of the loop.&nbsp;&nbsp;In<br>contrast, the original code is so long that we may have forgotten, which<br>is why each menu command appears to repeat the &quot;Choose an option:&quot;
<br>question.<br><br>(When you learn a little more about Python, we can talk about the concept<br>of &quot;dispatch tables&quot; to further dissolve that code, but let's talk about<br>that later.)<br><br>I guess I'm trying to say: style can mattes because it can help you fix
<br>your program's bugs faster.&nbsp;&nbsp;*grin*<br><br><br>Best of wishes to you!<br><br>_______________________________________________<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">
http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br><br><br>-- <br>'There is only one basic human right, and that is to do as you damn well please.<br>And with it comes the only basic human duty, to take the consequences.'