Richard Querin wrote: > My question before I start is whether or not using an XML format for the > individual file formats is the way to go, and if I have to anticipate > every little thing in the file formats before hand. I don't want to do > this, I would rather like to be able to just add and modify things as I > go with the least amount of hassle along the way. Any ideas on how to > generally approach the file formats? >
To quote PJE in http://dirtsimple.org/2004/12/python-is-not-java.html (Python is not JAVA) --- XML is not the answer. It is not even the question. To paraphrase Jamie Zawinski on regular expressions, "Some people, when confronted with a problem, think "I know, I'll use XML." Now they have two problems." --- Now seriously. Are there file formats meant to be used and understood by other programs in principle (we know it is a nice feature, but is it necessary?)? If the answer is yes, then XML may be the solution. Looks like what you are trying to accomplish can be done wrapping functionality into modules, then adding them together (classes, functions, etc) using a GUI master program. Saving complex data structures to files in Python is easy. Let it be pickling or using a Python database, like Kirbybase or Gadfly. If you need to communicate this to other applications, you may use simple extensions like those in XML-RPC(still no XML design and/or parsing). As for anticipating every single thing in the file format, this depends on whether you need to have fancy things like backwards compatibility. I would guess some dynamic data structure that allows for extension (like a dictionary of attributes, where you can always add new attributes) will do. hope this rant helps a bit Hugo > Any suggestions would be greatly appreciated. > > I have zero experience with XML at this point, and very modest > experience with Python/wxPython, but necessity is the mother of > invention and I can learn what I need to know I think. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor