If you used breakpoint()
in your code, you can disable all those breakpoints by environment variable.
import os
os.environ['PYTHONBREAKPOINT'] = '0'
This also work when you are in (Pdb) interactive state, this will disable all breakpoint()
inserted in your code, but not breakpoints enabled by (Pdb).
So lets test this, code have breakpoint()
in line 4:
> /tmp/py.py(5)<module>()
-> print(x,a)
(Pdb) ll
1
2 for x in "abcdefg":
3 a=1
4 breakpoint()
5 -> print(x,a)
6 b=2
7 print(x,b)
Lets set new breakpoint in line 6.
(Pdb) break 6
Breakpoint 1 at /tmp/py.py:6
(Pdb) break
Num Type Disp Enb Where
1 breakpoint keep yes at /tmp/py.py:6
Now lets disable all breakpoint()
in this case in line 4.
(Pdb) import os
(Pdb) os.environ['PYTHONBREAKPOINT'] = '0'
and continue
(Pdb) c
a 1
> /tmp/py.py(6)<module>()
-> b=2
(Pdb) ll
1
2 for x in "abcdefg":
3 a=1
4 breakpoint()
5 print(x,a)
6 B-> b=2
7 print(x,b)
now it stops in line 6 and skip line 4, lets continue
(Pdb) c
a 2
b 1
> /tmp/py.py(6)<module>()
-> b=2
now it stops again in line 6 and skip line 4
(Pdb) break
Num Type Disp Enb Where
1 breakpoint keep yes at /tmp/py.py:6
(Pdb) clear 1
Deleted breakpoint 1 at /tmp/py.py:6
now (Pdb) breakpoint in line 6 is deleted and program can continue working:
(Pdb) c
b 2
c 1
c 2
d 1
d 2
e 1
e 2
f 1
f 2
g 1
g 2