So what I’m looking for here is something like PHP’s print_r function.
This is so I can debug my scripts by seeing what’s the state of the object in question.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are really mixing together two different things.
Use
dir(),vars()or theinspectmodule 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: