Question : python debugger
Answered by : cooper-hanson
#preinstalled package
import pdb; pdb.set_trace()
Source : | Last Update : Wed, 24 Jun 20
Question : pdb debugger
Answered by : nutty-newt-cwmffe71tr9y
import pdb
def fact(x): f = 1 for i in range(1,x+1): pdb.set_trace() print (i) f = f * i return f
if __name__=="__main__": print ("factorial of 3=",fact(3))
Source : | Last Update : Fri, 03 Jul 20
Question : Debugging python pdb
Answered by : marc-yeranosyan
$ python -m pdb my_script.py
We can set break points in the script itself so that you can inspect the variables and stuff at particular points. This is possible using the pdb.set_trace() method. Here is an example:
import pdb
def make_bread(): pdb.set_trace() return "I don't have time"
print(make_bread())
Commands:
c: continue execution
w: shows the context of the current line it is executing.
a: print the argument list of the current function
s: Execute the current line and stop at the first possible occasion.
n: Continue execution until the next line in the current function is reached or it returns.
Source : https://book.pythontips.com/en/latest/debugging.html | Last Update : Sun, 04 Dec 22
Question : debugging python
Answered by : felipe-soares-barbosa-silveira
import ipdb; ipdb.set_trace()
Source : | Last Update : Wed, 10 Jun 20