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@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to