Python – Breakpoints in Python 3.7 ()

Breakpoints in Python 3.7 ()… here is a solution to the problem.

Breakpoints in Python 3.7 ()

What is the new breakpoint() in Python 3.7 and how can we use it effectively?
The documentation provides the declaration that this function takes you to the debugger that calls the site. But how do we use it?

a = "Hello,"
b = " World!"
print("a > ",a)
breakpoint()
print("b > ",b)

Solution

It is recommended for debugging so that you can easily hook up other third-party debuggers on the fly. Create a script with your code and run it.
For example:

C:\Python373>notepad break_001.py

C:\Python373>python.exe break_001.py
a >  Hello,
> c:\python373\break_001.py(5)<module>()
-> print("b > ",b)
(Pdb) c
b >   World!

C:\Python373>

This allows you to use the PDB debugger.

Related Problems and Solutions