Frage

How would you do this for an instance of xml.etree.cElementTree.Element?

$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
>>> from xml.etree.cElementTree import Element 
>>> obj = Element('aaa')
>>> obj
<Element 'aaa' at 0x101bde270>
>>> dir(obj)
['__copy__', '__deepcopy__', '__reduce__', 'append', 'clear', 'extend', 'find', 'findall', 'findtext', 'get', 'getchildren', 'getiterator', 'insert', 'items', 'iter', 'iterfind', 'itertext', 'keys', 'makeelement', 'remove', 'set']
>>> obj.tag
'aaa'

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top