The Occasional Occurence

CherryPy and the Interactive Interpreter

March 05, 2006 at 10:37 PM | categories: Python, cherrypy, General

I read a couple blog entries in the past week about the Python interactive interpreter and how great it is. I have always found the interactive interpreter extremely useful, not to mention downright fun to mess around with. It is truly one of the really neat features of Python.

Reading those entries reminded me that I wanted to post something about how easy it is to mess around with CherryPy from within the interactive interpreter. Maybe you can do this in some of the other hip Python web frameworks as well; I'm not sure.

To showcase this Python/CherryPy goodness, I have created my first nerd^H^H^H^Hscreencast*. It's short and pretty basic, but you should get the general idea. I think it further showcases the pythonic nature of CherryPy. Pardon the sketchy monologue by yours truly.

CherryPy Interactive ~1MB, Flash

The concepts in this simple demo can be used to do real interactive debugging. You could turn off the autoreloader and logging to screen in an app you are developing and run it like python -i start_your_app.py or ipython start_your_app.py. You are then inside the running application, and you can make requests to it from a browser and poke around inside using the interactive interpreter.

That's all. Feedback welcome.

cw

*Thanks to Wink, Audacity and swftools