CherryPy and the Interactive Interpreter

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

3 Responses to “CherryPy and the Interactive Interpreter”

  1. Kevin Dangoor Says:

    Nice screencast! I would never have thought of experimenting with CherryPy in that way!

    I will note that the TurboGears toolbox includes a browser-based (ajaxian) python shell. You should be able to attach one of those to a TurboGears app and monkey with your running TurboGears app from there.

  2. Uche Ogbuji Says:

    I can’t view this in Firefox/Linux. Any chance we could have a version in a more universal format such as MPEG?

    –Uche

  3. Uche Ogbuji Says:

    Never mind. Figured it out. I thought I had Flash installed, but after a bit of a fiddle, it reinstalled and the screencast showed.

Leave a Reply