[Tutor] XML Programs

Glen glenuk at gmail.com
Wed Apr 18 03:39:27 EDT 2018


Hello Stefan,

Thank you for this. That's actually quite helpful!

Regards,

On 17 April 2018 at 19:56, Stefan Behnel <stefan_ml at behnel.de> wrote:

> Glen schrieb am 16.04.2018 um 13:10:
> > I'm writing a save-game editor for a game I play (just a project to
> learn).
> > But I am struggling on how to structure the code, how to store the xml
> data
> > in data structure etc,
> >
> > Can anyone recommend some source I can review that reads and writes data
> > from an xml file.
>
> Here's a tutorial for the lxml package:
>
> http://lxml.de/tutorial.html
>
> However, I'd first check if there really is no Python library yet that
> handles your "game files", whatever format they may have. One of the most
> important things to learn about software engineering is to know when *not*
> to write code to solve a problem.
>
> If you end up having (or wanting) to deal with the bare XML format
> yourself, you may consider implementing your own XML API for your format,
> so that you can nicely assign functionality to certain tags in the document
> tree. See the section on "Implementing Namespaces" here:
>
> http://lxml.de/element_classes.html
>
> Stefan
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list