Also - <br>
<br>
menu_choice = 
  input(&quot;Choose an option: &quot;)<br>
<br>
input() is always bad. Use int(raw_input(&quot;&quot;Choose an option: &quot;))
instead. input() evaluates your input as a Python expression - I could
select 9 by entering 5+4<br>
<br>
or, I could enter sys.exit() and drop to DOS (or whatever it's running
on.) or far more malicious code, like deleting everything on C: drive<br>
<br>
list[site] = id and passcard <br>
I'm not sure if that's real or a comment. Possibly you meant list[site] = id + passcard ?<br>
<br>
<br>
...Or, it could be this - <br>
<br>
if 
  site.has_key(site):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  print &quot;The ID is: 
  &quot;,id(site)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  print &quot;The password is: 
  &quot;,passcard(site)<br>
<br>
id(site) - if you have functions called id and passcard, I can't see
them, if id and passcard are collections (list/dictionary) I can't see
them. <br>
<br>
If they are functions, id() is a builtin Python function. <br>
<br>
If they are collections, then the correct way to access member items is to use id[site] or<br>
passcard[site].<br>
<br>
But, now I'm guessing. Please post error message. And, if you need to
post code, please post all relevant code, I recommend
<a href="http://www.rafb.net/paste/">http://www.rafb.net/paste/</a> to have it formatted nicely and even colour
coded.<br>
<br>
Regards, <br>
<br>
Liam Clarke<br>
<br><br><div><span class="gmail_quote">On 7/5/05, <b class="gmail_sendername">Liam Clarke</b> &lt;<a href="mailto:cyresse@gmail.com">cyresse@gmail.com</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;">
What error messages are you getting? Please post the full message.<br><br><div><div><span class="e" id="q_104e4ab0a5832a6b_1"><span class="gmail_quote">On 7/5/05, <b class="gmail_sendername">Nathan Pinno</b> &lt;<a href="mailto:falcon3166@hotmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
falcon3166@hotmail.com
</a>&gt; wrote:</span></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span class="e" id="q_104e4ab0a5832a6b_3">






<blockquote><label></label>
  <div>What's wrong with this code? I'm using 2.2.3 if this helps.</div>
  <div>&nbsp;</div>
  <div>#This is for a password protected program to store passwords.</div>
  <div>password = &quot;hello&quot;<br>print &quot;The Password Program&quot;<br>print &quot;Copywrite 
  2005. All Rights Reserved.&quot;<br>print<br>answer = raw_input(&quot;What is the 
  password? &quot;)<br>while password != answer:<br>&nbsp;&nbsp;&nbsp; print &quot;The 
  password is incorrect.&quot;<br>def main_menu():<br>&nbsp;&nbsp;&nbsp; print &quot;1) 
  Add a login info card&quot;<br>&nbsp;&nbsp;&nbsp; print &quot;2) Lookup a login info 
  card&quot;<br>&nbsp;&nbsp;&nbsp; print &quot;3) Remove a login info 
  card&quot;<br>&nbsp;&nbsp;&nbsp; print &quot;4) Print Login info 
  list&quot;<br>&nbsp;&nbsp;&nbsp; print &quot;5) Save login list&quot;<br>&nbsp;&nbsp;&nbsp; 
  print &quot;6) Open Login list&quot;<br>&nbsp;&nbsp;&nbsp; print &quot;9) Exit&quot;</div>
  <div>&nbsp;</div>
  <div>def load_login(site,filename):<br>&nbsp;&nbsp;&nbsp; in_file = 
  open(filename,&quot;r&quot;)<br>&nbsp;&nbsp;&nbsp; while 
  1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in_line = 
  in_file.readline()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if 
  len(in_file) == 
  0:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  break<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in_line = 
  in_line[:-1]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [site,id,passcard] 
  = string.split(in_line,&quot;,&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  list[site] = id and passcard<br>&nbsp;&nbsp;&nbsp; 
  in_file.close()<br>&nbsp;&nbsp;&nbsp; <br>def 
  save_login(site,filename):<br>&nbsp;&nbsp;&nbsp; out_file = 
  open(filename,&quot;w&quot;)<br>&nbsp;&nbsp;&nbsp; for x in 
  site.keys():<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  out_file.write(x+&quot;,&quot;+sites[x]+&quot;\n&quot;)<br>&nbsp;&nbsp;&nbsp; 
  out_file.close()<br>&nbsp;&nbsp;&nbsp; <br>menu_choice = 0<br>list = 
  {}<br>print &quot;Welcome to the second half of the program.&quot;<br>print 
  main_menu()<br>while menu_choice != 9:<br>&nbsp;&nbsp;&nbsp; menu_choice = 
  input(&quot;Choose an option: &quot;)<br>&nbsp;&nbsp;&nbsp; if menu_choice == 
  1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Add a login info 
  card&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; site = raw_input(&quot;Site: 
  &quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id = raw_input(&quot;User ID: 
  &quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; passcard = 
  raw_input(&quot;Password: &quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  list[site] = id and passcard<br>&nbsp;&nbsp;&nbsp; elif menu_choice == 
  2:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Lookup a login info 
  card&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; site = raw_input(&quot;Site: 
  &quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if 
  site.has_key(site):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  print &quot;The ID is: 
  &quot;,id(site)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  print &quot;The password is: 
  &quot;,passcard(site)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  print site,&quot; was not found.&quot;<br>&nbsp;&nbsp;&nbsp; elif menu_choice == 
  3:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Remove a login info 
  card&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; site = raw_input(&quot;Site: 
  &quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if 
  sites.has_key(site):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  del numbers[site]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  print site,&quot; was not found.&quot;<br>&nbsp;&nbsp;&nbsp; elif menu_choice == 
  4:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Login 
  Info&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for x in 
  site.keys():<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  print &quot;Site: &quot;,x,&quot; \tID: &quot;,numbers[x],&quot; \tPassword: 
  &quot;,numbers[x]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  print<br>&nbsp;&nbsp;&nbsp; elif menu_choice == 
  5:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filename = 
  raw_input(&quot;Filename to save: &quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  save_login(list,filename)<br>&nbsp;&nbsp;&nbsp; elif menu_choice == 
  6:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filename == 
  raw_input(&quot;Filename to load: &quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  load_login(list,filename)<br>print &quot;Have a nice day!&quot;<br></div>
  <div>Thanks,</div>
  <div>Nathan Pinno<br>Crew, McDonalds Restaurant, Camrose, AB Canada<br><a href="http://www.npinnowebsite.ca/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.npinnowebsite.ca/</a></div>

</blockquote>
<p></p></span></div>

<br>_______________________________________________<br>Tutor maillist &nbsp;- &nbsp;<a href="mailto:Tutor@python.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

http://mail.python.org/mailman/listinfo/tutor</a><br><br><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.'

</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.'