lisper learning python, ... could you please comment my first python program?
michele.simionato at gmail.com
Sun Aug 26 19:40:28 CEST 2007
On Aug 26, 5:56 pm, neptundan... at gmail.com wrote:
> 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
recommend you to have a look at the shlex module in the standard
and to pyparsing. Looking at their source code should should give you
idea. BTW, since you are familiar with Lisp, I would recommend you
for a better interactive experience.
More information about the Python-list