[sage-devel] Re: Parsing XML in Sage

2013-09-23 Thread Bill Janssen
I have an spkg for lxml (required for JModelica) and I intend to make it available in the near future. Bill On Tuesday, September 17, 2013 4:45:22 AM UTC-7, Nathann Cohen wrote: > > Hell everybody ! > > We have in Sage an interface with ISGCI [1], and most of the code it > contains amou

Re: [sage-devel] Re: Parsing XML in Sage

2013-09-17 Thread Vincent Delecroix
Here is an answer {{{ sage: class A(object): : def __getattribute__(self, name): : return name : sage: a = A() sage: a.b 'b' sage: a.nathann 'nathann' }}} Actually, the tab completion looks really funny on this object! 2013/9/17, Nathann Cohen : >> I would suggest that you

Re: [sage-devel] Re: Parsing XML in Sage

2013-09-17 Thread Nathann Cohen
> I would suggest that you start with Python's own xml.etree: > > import xml.etree.cElementTree as ET > tree = ET.ElementTree(file='document.xml') > root = tree.getroot() > for child in root: > print(child.tag, child.attrib) I will never understand how XML can be so awful to use in Python or i

[sage-devel] Re: Parsing XML in Sage

2013-09-17 Thread Volker Braun
I would suggest that you start with Python's own xml.etree: import xml.etree.cElementTree as ET tree = ET.ElementTree(file='document.xml') root = tree.getroot() for child in root: print(child.tag, child.attrib) On Tuesday, September 17, 2013 12:45:22 PM UTC+1, Nathann Cohen wrote: > > Hell