[Tutor] bug hunting again

Lloyd Kvam pythontutor@venix.com
Mon, 08 Jul 2002 14:58:12 -0400


That worked here!?

Kyle Babich wrote:

> Ok now my problem is this:
> 
>   File "hourtracker.py", line 92, in ?
>     if username.lower() in "kyle jason chelsea john cheryl".split():
> AttributeError: 'string' object has no attribute 'lower'
> 
> But I don't see what is wrong.
> I have attached a new copy.
> 
> On Mon, 8 Jul 2002 17:50:25 +0100 , alan.gauld@bt.com said:
> 
>>A quick look suggests you don't actually start the 
>>program anywhere in your file.
>>
>>How are you trying to run it?
>>
>>
>>>been working on (from my last few messages).  Something is 
>>>stopping the program from running 
>>>
>>What actually happens? Do you get any errors?
>>Either from DOS, Windows or Python?
>>
>>
>>>Please tell me if you can find what is stopping the program from
>>>running.  Thank you.
>>>
>>Assuming you want it to run by double clicking the file icon
>>you will need something like:
>>
>>if __name__ == "__main":
>>    hour()
>>
>>If you are importing it into IDLE(say) then you should 
>>get something back when you type time.hour()
>>
>>BUT as somebody already pointed out naming things the same 
>>as python module names is a bad idea. When you import 
>>your time module you will hide the python time module.
>>Rename your file to hourtracker.py or something...
>>
>>Slightly confused and needing more info
>>
>>Alan G
>>
>>
>>
>>
>>
> 
> --
> Kyle
> 


-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice: 
603-443-6155
fax: 
801-459-9582