Print values ​​in pdb

this is the first time using a pdb debugger in python. Please forgive me if this is a stupid question.

When I spend on a function, inside the function I would like to print the values ​​of these variable names with an underscore at the beginning, for example. p __seqLen. He continues to show AttributeError: AttributeError("Converter instance has no attribute '__seqLen'",)I also tried to use p self.__seqLen. does not work. May I ask how can I print these values? thanks in advanced condition.

+3
source share
2 answers
p locals()
p globals()

may I help.

+7
source

, Python private name mangling. Python , . __somename _Class__somename.

+7

All Articles