[Tutor] bug hunting again

Kyle Babich Kyle Babich" <kb@kb5.org
Mon, 8 Jul 2002 18:32:59 +0000


This is a multi-part message in MIME format.

--_----------=_1026153179112942
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="ISO-8859-1"

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
--_----------=_1026153179112942
Content-Disposition: attachment; filename="hourtracker.py"
Content-Transfer-Encoding: base64
Content-Type: application/unknown; name="hourtracker.py"

IyEgQzpcUHl0aG9uMjJccHl0aG9uLmV4ZQ0KDQppbXBvcnQgdGltZQ0KaW1w
b3J0IHN5cw0KDQpkZWYgaG91cigpOg0KCWN1cnJ0aW1lID0gdGltZS5zdHJm
dGltZSggIiVJOiVNOiVTJXAgJVoiLCB0aW1lLmxvY2FsdGltZSh0aW1lLnRp
bWUoKSkgKQ0KCQ0KCWxvZ3QgPSBvcGVuKCAibG9nLmRhdCIsICJhIiApDQoJ
bG9ndC53cml0ZSggIiAgWyUoY3VycnRpbWUpc10iICUgdmFycygpICkNCgls
b2d0LmNsb3NlKCkNCgkNCglwcm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