A question about Stack

trunggauuoi trunggauuoi at insightbb.com
Sun Oct 5 02:45:43 EDT 2003


hi again.
I got this figured out. Just a stupid mistake

"trunggauuoi" <trunggauuoi at insightbb.com> wrote in message
news:%cNfb.499812$cF.176544 at rwcrnsc53...
> Hi,
>
> I'm trying to use stack to build a HTMLTree for my parser. There is a
> HTMLTreeNode class. Each time I encounter a tag or text, I need to create
> and initialize a HTMLTreeNode and put it in a htmltree and a stack. The
> stack is the list of objects (HTMLTreeNode objects). I want to retrieve
the
> instance from the stack to use it to append some info to the instance.
> However, I can't append anything to the instace that I just got from the
> stack. Actually, if I print out the stack, it will look like this:
>
> [<parserExample.HTMLTreeNode instance at 0x00A87030>]
> [<parserExample.HTMLTreeNode instance at 0x00A87058>]
>
> If I try to add something to the instance I got, I will receive an error
> message saying that the instance has no attributes, which are actually in
> the instance when I added it to the stack.
> I have no idea how to deal with this.
>
> Any help would be greatly appreciated
>
> Many thanks
>
> Trung
>
>
>
>






More information about the Python-list mailing list