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>
"<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>
"<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> <<a href="mailto:dyoo@hkn.eecs.berkeley.edu">
dyoo@hkn.eecs.berkeley.edu</a>> 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. I believe that the second<br>half could look something like this:<br><br>######<br>while menu_choice != 9:
<br> menu_choice = input("Choose an option:")<br> if menu_choice == 1:<br> add_login_command()<br> elif menu_choice == 2:<br> lookup_login_command()<br> elif menu_choice == 3:<br> remove_login_command()
<br> elif menu_choice == 4:<br> display_login_command()<br> elif menu_choice == 5:<br> save_login_command()<br> elif menu_choice == 6:<br> 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. 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. 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 "Choose an option:"
<br>question.<br><br>(When you learn a little more about Python, we can talk about the concept<br>of "dispatch tables" 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. *grin*<br><br><br>Best of wishes to you!<br><br>_______________________________________________<br>Tutor maillist - <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.'