On 13/07/2019 07:40, Asad wrote: > want to print the output of the script in a xml file so that I can add some > tags . How can it be done ?
XML is just text dso you can just use the normal Python string operations to format an XML string with your data. However there are XML libraries aplenty that can aid you in constructing a valid XML tree structure. The standard library contains an xml package which includes the dom module which might be a good starting place if you want to understand the concepts. The etree module is probably easier to use in the long term though. Look at the "Building XML documents" section in the etree documentation. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor