ElementTree and proper identation?

John Salerno johnjsal at NOSPAMgmail.com
Wed Sep 27 14:33:13 EDT 2006


Fredrik Lundh wrote:
> John Salerno wrote:
> 
>> Well, further research reveals that this function isn't available yet 
>> in any version.
> 
> what keeps you from using the source code on the page you're talking 
> about ?
> 
> </F>
> 

Yeah, actually I just gave this a try but I couldn't figure out where 
the code needed to go or how to call the function. I tried creating an 
Element with a few SubElements, then I did:

print >> filename, indent(root)

But that only wrote the value "None" into the file.



More information about the Python-list mailing list