[Tutor] files - strings - lists

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Wed Nov 23 19:39:51 CET 2005



On Wed, 23 Nov 2005, Chris or Leslie Smith wrote:

> I agree that handling this with Python is pretty straightforward, but
> I'm wondering if there exists some sort of mechanism for reading these
> types of well structured (though not XML format, etc...) files.

Hi Chris,

Yes, take a look at "parser" tools like pyparsing, mxTextTools, and
Martel:

    http://pyparsing.sourceforge.net/

    http://www.egenix.com/files/python/mxTextTools.html

    http://www.dalkescientific.com/Martel

I have to admit that I don't use these tools much, since my data is
already in some kind of predefined structure.  If it's at all possible,
I'd recommend sticking with pre-defined formats like XML: parsing can be a
tedious job at times.



More information about the Tutor mailing list