python pdb调试模块使用

一般在需要调试的文件加入下面代码即可

################

_DEBUG = True

...

if _DEBUG == True

  import pdb

  pdb.set_trace()

################

之后执行文件,就会进入调试状态,常用调试命令和gdb下基本一样,相当好用

如 c (continue) ,n(next),p(print),s(step into) ,bt(打印堆栈)

posted @ 2014-01-09 12:58  lc_cnblog  阅读(1514)  评论(0编辑  收藏  举报