pyparsing question

hubritic colinlandrum at gmail.com
Wed Jan 2 03:39:21 EST 2008


On Jan 1, 4:18 pm, John Machin <sjmac... at lexicon.net> wrote:
> On Jan 2, 10:32 am, hubritic <colinland... at gmail.com> wrote:
>
> > The data I have has a fixed number of characters per field, so I could
> > split it up that way, but wouldn't that defeat the purpose of using a
> > parser?
>
> The purpose of a parser is to parse. Data in fixed columns does not
> need parsing.
>
> >  I am determined to become proficient with pyparsing so I am
> > using it even when it could be considered overkill; thus, it has gone
> > past mere utility now, this is a matter of principle!
>
> An extremely misguided "principle".  Would you use an AK47 on the
> flies around your barbecue? A better principle is to choose the best
> tool for the job.

Your principle is no doubt the saner one for the real world, but your
example of AK47 is a bit off.
We generally know enough about an AK47 to know that it is not
something to kill flies with. Consider, though, if
someone unfamiliar with the concept of guns and mayhem got an AK47 for
xmas and was only told that it was
really good for killing things. He would try it out and would discover
that indeed it kills all sorts of things.
So he might try killing flies. Then he would discover the limitations;
those already familiar with guns would wonder
why he would waste his time.



More information about the Python-list mailing list