I have a pdb
trace set inside a GET
request. I want to print all the attributes of the request object. I am trying the following, in pdb:
(Pdb) request
<GET /foo HTTP/1.1>
(Pdb) for d in dir(request):
*** SyntaxError: unexpected EOF while parsing (<stdin>, line 1)
I am sure there is something fundamental I am missing here.
You can't enter multi-line statements in pdb
. You can use the commands
command if the code block is to be executed on a break point, though; help commands
for more information.
You can also sometimes collapse a multi-line statement into a single line. For example:
for d in dir(request): print d
In your particular case, though, it seems that either print dir(request)
or pp dir(request)
would suffice.