how come .insert() don't work

"Martin v. Löwis" martin at v.loewis.de
Wed Oct 27 23:51:27 CEST 2004


Bennie wrote:
> def tekst_in(self, tag):
>         tekst_tag={'p': '\t\t<p>\n\n\t\t</p>\n', 'br': '<br />'}
>         self.tekst.insert(INSERT, tekst_tag[tag])
> 
> Then I get a AttributeError...
> I seached the net, can come op white a answer.

What specific attribute is mentioned in the AttributeError?
That self has no attribute tekst, or that self.tekst has
no attribute insert?

If the former, you need to arrange your class so that self has
an attribute tekst (e.g. by initializing tekst in __init__).

If the latter: what kind of thing is self.tekst?

Regards,
Martin



More information about the Python-list mailing list