[Tutor] need help with lxml errors
Rayon
evosweet at hotmail.com
Sun May 22 14:48:13 CEST 2011
Wow I did not see that, long day and night :) thanks a lot.
Regards Rayon
-----Original Message-----
From: tutor-bounces+evosweet=hotmail.com at python.org
[mailto:tutor-bounces+evosweet=hotmail.com at python.org] On Behalf Of Steven
D'Aprano
Sent: Sunday, May 22, 2011 8:23 AM
To: tutor at python.org
Subject: Re: [Tutor] need help with lxml errors
On Sun, 22 May 2011 09:51:44 pm Rayon wrote:
> I am trying to import lxml
>
> from lxml import etree
And that succeeds fine. Your problem lies elsewhere.
> bb = etree.Element(self.get_time)
> return str(bb)
In future, please copy and paste (do NOT retype, simplify or summarize) the
full traceback you get, not just the error message.
In this case, I *think* I can *guess* your error, based on the error message
alone, but I could be completely off-base. But my guess is that you need:
bb = etree.Element(self.get_time())
rather than:
bb = etree.Element(self.get_time)
The later tries to insert a method get_time into the element tree. You need
to call the method by putting brackets () after it.
--
Steven D'Aprano
_______________________________________________
Tutor maillist - Tutor at python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list