What error messages are you getting? Please post the full message.<br><br><div><span class="gmail_quote">On 7/5/05, <b class="gmail_sendername">Nathan Pinno</b> &lt;<a href="mailto:falcon3166@hotmail.com">falcon3166@hotmail.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;">






<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>

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