[Tutor] Help with class in class

leam hall leamhall at gmail.com
Sun Sep 9 17:42:18 CEST 2012

I'm in the O'Reilly Python 2 class, so pointers to learning would be better
than just answers, please. My brain is a bit slow but needs to go forward.

Line 16 calls line 31. Rather, it is supposed to. I'm trying to figure out
why I get

  File "./ch8_project.py", line 31, in change_text_color
    self.text.tag_configure('highlightline', foreground=fg_color)
AttributeError: 'ch8_Project' object has no attribute 'text'

If line 31 starts with "self." and

  File "./ch8_project.py", line 31, in change_text_color
    text.tag_configure('highlightline', foreground=fg_color)
NameError: global name 'text' is not defined

If Line 31 does not start with "self.". I understand the second problem but
not the first.

What am I missing?



Mind on a Mission <http://leamhall.blogspot.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120909/280e2e2a/attachment.html>

More information about the Tutor mailing list