MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/pythontips/comments/mc4vfm/how_to_debug_in_python/gs55lpc/?context=3
r/pythontips • u/[deleted] • Mar 24 '21
Please share some tips about the title.
38 comments sorted by
View all comments
6
Really surprised no one mentioned:
import pdb
pdb.set_trace()
I put that anywhere I want to inspect what is going on and run the script! Then you can see what variables are at that point and also go through the code line by line!
2 u/mutatedllama Mar 25 '21 Yeah this is usually step 1 for me!
2
Yeah this is usually step 1 for me!
6
u/miamiredo Mar 25 '21
Really surprised no one mentioned:
import pdbpdb.set_trace()I put that anywhere I want to inspect what is going on and run the script! Then you can see what variables are at that point and also go through the code line by line!