How to quickly debug misbehaving script in Python without pdb?

后端 未结 3 1107
感情败类
感情败类 2021-01-29 12:58

There is a high level logic error deep within my Python script, and pdb doesn\'t help to debug it. Is there any other way to see what is being executed after I run

3条回答
  •  粉色の甜心
    2021-01-29 13:32

    I found a way to do this using excellent trace module that comes with Python.

    An example how to troubleshoot module installation problem:

    python -m trace -t setup.py install > execution.log
    

    This will dump all source line of setup.py install execution to execution.log. I find this more useful than pdb, because usability of pdb command line interface is very poor.

提交回复
热议问题