+ 3
How do I debug using pdb ?
instead of print debug
3 Answers
+ 2
just write this line before code to debug :
import pdb ; pdb.set_trace()
and run your program.The execution of the program will then freeze, and in console you will have access to a special shell :
(pdb)
then press on 'h' to get more help.
+ 1
adel thanks
What is difference between step and next command ?ăon (pdbïŒshell
+ 1
(n)ext allow you to run the next line even if the line contain a function call, (s)tep in the other hand jump inside that function to debug its content