Use pdb.set_trace() in a script that reads stdin via a pipe

前端 未结 6 1576
我寻月下人不归
我寻月下人不归 2020-12-05 04:20

I have a python script that reads stdin via a pipe, and I cannot seem to use it with pdb.set_trace().

my_script.py:

#!/usr/bin/env python
import sy         


        
6条回答
  •  -上瘾入骨i
    2020-12-05 05:01

    You may want to look at how the Celery RDB (Remote Debugger) contrib module works:

    https://github.com/celery/celery/blob/master/celery/contrib/rdb.py

    It seems to involve a lot of stream processing, but I have tested it, and it works by allowing you to telnet into a new local network port. It's not the much better ipdb, but simply pdb.

提交回复
热议问题