Mathieu Fenniak's Weblog

2002/10/25

I Love Python

Filed under: programming,python — admin @ 2:08 am

I really love Python. I mean, it’s as slick and clean as programming languages come, and both easy to learn and powerful.

Pythons libraries are often rather pathetic next to the language itself. For example, I ran into a problem when working on this weblog which it seems should have come up earlier: reading an XML file using xml.dom.pulldom does not create DOM CDATA sections, but rather text sections which happen to have the right data in them. This is great until you go to write the XML file, and it writes it as text and doesn’t include it as a CDATA section, thereby loosing the original content. Oops.

Well, I worked around this by using my own SAX handler to create a DOM tree, which kind or randomly guesses at whether the text should be CDATA or just plain text, because that’s the best the SAX interface seems to let me do. … well, damn, ye olde deprecated xmllib let me do this right…

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.

Powered by WordPress