[Tutor] Done -- Elementtree and pretty printing in Python 2.7

Knacktus knacktus at googlemail.com
Fri Aug 20 10:39:47 CEST 2010


Hi guys,

just found "hidden" in the "Schema change in Etree"-Thread the answer to 
my formatting question:

Quotation:
"
ElementTree doesn't have a way of formatting (pretty printing) XML 
files, so there can't be that many newline characters in the structure 
(they may be in the occur, though!). There's a pretty printing recipe on 
the effbot site that you can easily adapt to inject the newline 
characters you need.
"

The recipe works fine.

Cheers,

Jan


More information about the Tutor mailing list