'args' variable name is used in my project. When I use pdb.set_trace to debug, I want to print what's in the 'args' variable. The result is far different from my expect and I figured out pdb uses 'args' as its reserved word to keep something else. My question is how to print this 'args' variable without having to change the variable name to something not conflicting. Thanks.
I am using Python 3.4, in Windows command line console. Python pseudo code sample:
args = dict(blah='blah'...)
... some code deal with args
def foo():
pdb.set_trace() # when traced here, I type 'args' to show what it is, but looks like it's going to print arguments of foo method, which is None.
foo()
OK. I figured it out. Using pdb command, p(args) or pp(args) should save it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With