views:

94

answers:

3

hello all, my question is the following, which is the best way of working XML (kml) with python?, especially script serializable.

thanks for your attention and answers

+3  A: 

For Python and XML I routinely use xml.etree (see its documentation). The good thing with xml.etree is that it's included in the Python standard library. I've heard good things about lxml as well, which exposes an etree compatible api.

rlotun
I just wanted to chime in that `lxml` is SUPERB and fast, and its only downside is that it is a third-party lib.
jathanism
+2  A: 

lxml is very fast. With large data its best choice.

Edit: But "Note that lxml does not provide any thread-safety by itself (mainly for performance reasons), so you have to take care when you use parts of the API concurrently."

Vojtech R.
+1  A: 

For very small and simple things, xml.dom.minidom is the easiest route. If you're looking for something which can handle large files with very little memory usage then you'll want to use an xml.sax parser.

Gaz Davidson