Michele Simionato wrote: > 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? > > BTW, since you are familiar with Lisp, I would recommend you > IPython for a better interactive experience.
IPython's got great support for saving and using old results and a lot of other things. It's borderline unreadable for stack traces out of the box, though; putting "xtrace Plain" in your ipythonrc helps a lot. The color options (either turning it off or making it light/dark background appropriate) are also quite important to having it at all usable; depending on your default bg color that may not be an issue. And if you want to have a view of your data that's similar to the rest of the Python world (useful if you ever intend for others to look at your output or you to look at theirs), "pprint 0" is nice too. Sorry if that sounds like it's an indictment--it's a very nice shell aside from a few output weirdnesses that are easily configured. -- http://mail.python.org/mailman/listinfo/python-list