Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

assign values to symbols in python debugger (pdb)

Tags:

python

pdb

Using pdb.set_trace(), I am trying to debug a series of expression in which j is used as an indexing variable. statements such as j = 0 are not allowed since j is a reserved symbol for pdb. How can I get around this?

like image 353
hatmatrix Avatar asked Oct 27 '11 15:10

hatmatrix


1 Answers

!j = 0

From the docs:

[!]statement

Execute the (one-line) statement in the context of the current stack frame. The exclamation point can be omitted unless the first word of the statement resembles a debugger command.

like image 103
Sven Marnach Avatar answered Sep 23 '22 06:09

Sven Marnach