need a json representation of all members of any type of object, list or hashtable (php's var_dump)

Benjamin Kaplan benjamin.kaplan at
Tue Aug 10 04:43:24 CEST 2010

On Mon, Aug 9, 2010 at 7:18 PM, Rene Veerman <rene7705 at> wrote:
> hi.
> for 2 open source components of mine that are used in debugging, i
> would like to capture the output generated by print for any variable.
> i'm new to python, so please excuse my noobishness.
> i don't know if objects can be json-ed as easy as lists and hash
> tables are by print.
> and i couldn't find how to capture the output generated by print into
> a string, so i can't use it with google appengine :(
> i'm in dire need of some expert advise here.

Use str() to turn stuff into strings.

More information about the Python-list mailing list