在Python中,有没有办法在使用PDB进行调试时显示线程/进程ID?
我在看https://docs.python.org/2/library/pdb.html但找不到与之相关的任何内容?
(pdb) import os,threading; os.getpid(), threading.current_thread().ident
Run Code Online (Sandbox Code Playgroud)
如果您经常需要这样做,在.pdbrc文件中添加别名会很方便:
alias tid import os,threading;; p os.getpid(), threading.current_thread().ident
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1012 次 |
| 最近记录: |