Is there a built-in function to print all the current properties and values of an object?

You are really mixing together two different things. Use dir(), vars() or the inspect module to get what you are interested in (I use __builtins__ as an example; you can use any object instead). Print that dictionary however fancy you like: or Pretty printing is also available in the interactive debugger as a command:

pretty-print JSON using JavaScript

Pretty-printing is implemented natively in JSON.stringify(). The third argument enables pretty printing and sets the spacing to use: If you need syntax highlighting, you might use some regex magic like so: See in action here: jsfiddle Or a full snippet provided below: Show code snippet

pretty-print JSON using JavaScript

Pretty-printing is implemented natively in JSON.stringify(). The third argument enables pretty printing and sets the spacing to use: If you need syntax highlighting, you might use some regex magic like so: See in action here: jsfiddle Or a full snippet provided below: Show code snippet