代码之家  ›  专栏  ›  技术社区  ›  Matthew Rankin val

Python调试器入门,pdb[关闭]

  •  77
  • Matthew Rankin val  · 技术社区  · 15 年前

    我想补充 pdb Python调试器到我的工具箱。最好的开始方式是什么?

    2 回复  |  直到 8 年前
        1
  •  116
  •   Matthew Rankin    7 年前

    下面是使用Python调试器的资源列表:

    1. 读史蒂夫·费布的文章 "Debugging in Python"
    2. 看埃里克·霍尔舍尔的电影剧本 "Using pdb, the Python Debugger"
    3. 阅读 Python documentation for pdb — The Python Debugger
    4. 当你甚至不知道要记录什么时,请阅读第9章:使用Karen Tracey的调试器 Django 1.1 Testing and Debugging .
        2
  •  16
  •   Josh Glover    14 年前

    简介:

    # epdb1.py -- experiment with the Python debugger, pdb
    import pdb
    a = "aaa"
    pdb.set_trace()
    b = "bbb"
    c = "ccc"
    final = a + b + c
    print final
    

    现在运行脚本:

    $ python epdb1.py
    (Pdb) p a
    'aaa'
    (Pdb)