On 7/7/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: > Hi all, > > I meant to ask why the main part after the password is not working right. > No one has answered that yet. When I run the code and try to load a file > that has been saved, a TypeError appears. How do I fix the code so no more > errors will show up. Here is the newest code so far:
I don't get a TypeError, but a NameError. Reason is the line: filename == raw_input("Filename to load: ") which should be: filename = raw_input("Filename to load: ") After correcting this, I get the TypeError. And the error clearly says what is wrong: in_file is a file object, and those do not have the value "len". I think what you mean is done by replacing: if len(in_file) == 0: by: if len(in_line) == 0: In general, in such cases, check the error message. In this case it said "len() of an unsized object". There is only one len() in the line given, so that must be it, and thus in_file must be that 'unsized object'. Andre Engels _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor