Sunday, 19 April 2015

Right way to use lxml to generate xml in python



I'm trying to create xml that corresponds to structure of directory (with subdirectories and files in that subdirs). When i try to use this example: Best way to generate xml in python? instead of output from example, that is:


<root> <child/> <child>some text</child> </root>


i've got:



b'<root>\n <child/>\n <child>some text</child>\n</root>\n'


Why it so? Uses PyCharm IDE if it matters.


No comments:

Post a Comment