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

2010-08-09 Thread Rene Veerman
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 fin

getting the variable type

2010-07-11 Thread Rene Veerman
hi. i need to know the type of variable i'm dealing with. take this list: files = [ "lib/jquery/jquery-1.4.2.source.js", "lib/jquery-ui-1.8.1/development-bundle/ui/jquery-ui-1.8.1.custom.js", "lib/jquery-ui-1.8.1/development-bundle/ui/jquery.ui.tabs.js", "lib/jque

how do you do a count of a result set?

2010-07-09 Thread Rene Veerman
hi. i'm using this function; def dbCacheGet(self, appParams): results = db.GqlQuery( "SELECT * " "FROM DBcache " "WHERE url='"+appParams['urlCalled']+"'" ).fetch(1) if results.count('*')==0:

how do you print an object?

2010-07-09 Thread Rene Veerman
hi. i'm a recent convert from php because google appengine runs python. i have a whole cms backend to convert (also to bigtable, but thats another story) to python now. the first item on my agenda is the printing of python objects to json objects. i have this nifty xhtml dataviewer (htmlMicroscop