Python 调试器 pdb 入门

发布于 2024-10-03 14:29:13 字数 1536 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

葬﹪忆之殇 2024-10-10 14:29:13

以下是开始使用 Python 调试器的资源列表:

  1. 阅读 Steve Ferb 的文章 "在 Python 中调试"
  2. 观看 Eric Holscher 的截屏视频 "使用 Python 调试器 pdb"
  3. 阅读 pdb 的 Python 文档 — Python 调试器
  4. 阅读 Karen Tracey 的第 9 章 — 当您甚至不知道要记录什么时:使用调试器 Django 1.1 测试和调试

Here's a list of resources to get started with the Python debugger:

  1. Read Steve Ferb's article "Debugging in Python"
  2. Watch Eric Holscher's screencast "Using pdb, the Python Debugger"
  3. Read the Python documentation for pdb — The Python Debugger
  4. Read Chapter 9—When You Don't Even Know What to Log: Using Debuggers—of Karen Tracey's Django 1.1 Testing and Debugging.
顾冷 2024-10-10 14:29:13

概要:

# 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)

Synopsis:

# 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

Now run your script:

$ python epdb1.py
(Pdb) p a
'aaa'
(Pdb)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文