pdb && cProfile

pdb https://docs.python.org/zh-cn/3.7/library/pdb.html#module-pdb 使用方式 1、在命令行下直接运行调试 1python -m pdb test.py 2、在需要被调试的代码中添加import pdb、pdb.set_trace()再运行代码进行调试

Python