Message99777
>>> import xml.etree.cElementTree as ET
>>> tree = ET.parse('test.xml')
>>> root = tree.getroot()
>>> dir(root)
['!__reduce__', '__class__', '__copy__', '__deepcopy__', '__delattr__', '__delitem__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'find', 'findall', 'findtext', 'get', 'getchildren', 'getiterator', 'insert', 'items', 'keys', 'makeelement', 'remove', 'set']
>>> root.tag
'{http://testnamespace}root'
The tag property is not listed in dir() making ElementTree more difficult to use for those of us with poor memories. |
|
Date |
User |
Action |
Args |
2010-02-22 16:36:03 | ArcRiley | set | recipients:
+ ArcRiley |
2010-02-22 16:36:03 | ArcRiley | set | messageid: <1266856563.54.0.534391635456.issue7990@psf.upfronthosting.co.za> |
2010-02-22 16:36:02 | ArcRiley | link | issue7990 messages |
2010-02-22 16:36:01 | ArcRiley | create | |
|