[Tutor] bug hunting again

Andrei Kulakov ak@silmarill.org
Mon, 8 Jul 2002 15:40:28 -0400


On Mon, Jul 08, 2002 at 06:32:59PM +0000, 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'
>
You must have a rather old python. Either upgrade or use:

import string
string.lower(username)

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


-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org