lisper learning python, ... could you please comment my first python program?

Michele Simionato michele.simionato at gmail.com
Sun Aug 26 13:40:28 EDT 2007


On Aug 26, 5:56 pm, neptundan... at gmail.com wrote:
> Hi,
>   to extend my skills, I am learning python. I have written small
> program which computes math expression like "1+2*sin(y^10)/cos(x*y)"
> and similar, so far only + - * / ^ sin con tan sqrt are supported. But
> my program is quite inextensible, I have to change the code to add new
> functions... Could some fellow experienced pythonista give me some
> tips how to make my program shorter, and more extensible?

I understand that you are doing this as a learning exercise. Still, I
would
recommend you to have a look at the shlex module in the standard
library
and to pyparsing. Looking at their source code should should give you
some
idea. BTW, since you are familiar with Lisp, I would recommend you
IPython
for a better interactive experience.

  Michele Simionato




More information about the Python-list mailing list