Python Forum
Is there a keyword that's equivalent to breakpoint for debugging?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a keyword that's equivalent to breakpoint for debugging?
#4
Quote:if you are using IDE lie PyCharm, do you really need this pdb library
check out this image:
   
Just click in the left margin to set breakpoint.
lower right window are watches, you can type variable names here, or even code, and it will show their values as you step through the program

The blue arrows are for (in order:
step to next line (single step)
step to next line executed
step to next line executed (but ignore libraries)
step into routine (subroutine for example)using any filters setup
step to first line executed after returning from method
run to line where cursor is located.

It works very well, and I use it all the time.

A trick I use in iterators is to set a counter to zero before entering the loop,
incrementing at the end of each iteration, and then placing some code like:
if counter == 21:
    print('breakpoint here')
and setting the breakpoing to the print statement
you can do the same using the value of a programming variable like account number for example.
Reply


Messages In This Thread
RE: Is there a keyword that's equivalent to breakpoint for debugging? - by Larz60+ - Feb-16-2018, 11:15 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Find a specific keyword after another keyword and change the output sgtmcc 5 894 Oct-05-2023, 07:41 PM
Last Post: deanhystad
  pydev error pydev debugger: warning: trying to add breakpoint to file that does not e kwhhst 8 9,219 Jun-15-2019, 02:52 PM
Last Post: kwhhst
  equivalent commands saeed_balk 2 2,772 Sep-23-2018, 05:44 AM
Last Post: saeed_balk
  gdb breakpoint in python module Viesturs 0 2,251 Jul-27-2018, 02:02 PM
Last Post: Viesturs

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020