What is a Python equivalent of PHP's var_dump()? [duplicate]
To display a value nicely, you can use the pprint module. The easiest way to dump all variables with it is to do
from pprint import pprintpprint(globals())pprint(locals())
If you are running in CGI, a useful debugging feature is the cgitb module, which displays the value of local variables as part of the traceback.