On Aug 26, 5:56 pm, [EMAIL PROTECTED] 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

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to