set pdb break condition based upon number of hits?

R

Reckoner

Is it possible to set pdb break condition based upon number of hits? I
mean something like

(Pdb) break line_number (number_of_hits_for_this_breakpoint >10)

any help appreciated.
 
D

Diez B. Roggisch

Reckoner said:
Is it possible to set pdb break condition based upon number of hits? I
mean something like

(Pdb) break line_number (number_of_hits_for_this_breakpoint >10)

any help appreciated.

MY_GLOBAL_COUNTER = 0

MY_GLOBAL_COUNTER += 1
if MY_GLOBAL_COUNTER >= 10:
import pdb; pdb.set_trace()

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top