调试和分析¶
这些库可以帮助你进行 Python 开发:调试器使你能够逐步执行代码,分析堆栈帧并设置中断点等等,性能分析器可以运行代码并为你提供执行时间的详细数据,使你能够找出你的程序中的瓶颈。 审计事件提供运行时行为的可见性,如果没有此工具则需要进行侵入式调试或修补。
- 审计事件表
- bdb--- 调试器框架- BdbQuit
- Breakpoint
- Bdb- canonic()
- reset()
- trace_dispatch()
- dispatch_line()
- dispatch_call()
- dispatch_return()
- dispatch_exception()
- is_skipped_line()
- stop_here()
- break_here()
- break_anywhere()
- user_call()
- user_line()
- user_return()
- user_exception()
- do_clear()
- set_step()
- set_next()
- set_return()
- set_until()
- set_trace()
- set_continue()
- set_quit()
- set_break()
- clear_break()
- clear_bpbynumber()
- clear_all_file_breaks()
- clear_all_breaks()
- get_bpbynumber()
- get_break()
- get_breaks()
- get_file_breaks()
- get_all_breaks()
- get_stack()
- format_stack_entry()
- run()
- runeval()
- runctx()
- runcall()
 
- checkfuncname()
- effective()
- set_trace()
 
- faulthandler--- 转储 Python 回溯信息
- pdb--- Python 的调试器
- Python 性能分析器
- timeit--- 测量小代码片段的执行时间
- trace--- 跟踪或记录 Python 语句的执行
- tracemalloc--- 跟踪内存分配