使用pdb调试

pdbpython内置的一个调试库,是调试python代码的好帮手

1
2
import pdb
pdb.set_trace()
1
2
3
4
5
6
7
8
9
10
11
12
13
(Pdb) h
Documented commands (type help <topic>):
========================================
EOF bt cont enable jump pp run unt
a c continue exit l q s until
alias cl d h list quit step up
args clear debug help n r tbreak w
b commands disable ignore next restart u whatis
break condition down j p return unalias where

(Pdb) h c
c(ont(inue))
Continue execution, only stop when a breakpoint is encountered.

Arroz que no se menea,se quema.