[Tutor] Input to python executable code and design question
Kent Johnson
kent37 at tds.net
Mon Jan 10 03:00:34 CET 2005
jfouhy at paradise.net.nz wrote:
> Quoting Ismael Garrido <ismaelgf at adinet.com.uy>:
>
>
>>(Newbie looking scared) That's kind of hard for me... Parsing it myself
>>is too complex for me. Also, I hoped Python's math would do the job for
>>me, so I wouldn't have to make what's already done in Python.
>
>
> Writing (and understanding) grammar is probably easier than you think --- once
> you get over the syntax. And they are fantastically useful things for doing any
> sort of parsing. But no matter..
If you are interested in learning about parsing, I suggest looking at pyparsing - it is IMO the
easiest of the Python parsing frameworks. It has an example that implements a four-function
calculator so that would get you off in the right direction.
http://pyparsing.sourceforge.net/
Kent
More information about the Tutor
mailing list