Can I put a breakpoint in a running Python program that drops to the interactive terminal?

后端 未结 6 2107
清酒与你
清酒与你 2020-12-24 06:51

I\'m not sure if what I\'m asking is possible at all, but since python is an interpreter it might be. I\'m trying to make changes in an open-source project but because there

6条回答
  •  庸人自扰
    2020-12-24 07:06

    You can run the program using pdb, and add breakpoints before starting execution.

    In reality though, it's usually just as fast to edit the code and put in the set_trace() call, as another user stated.

提交回复
热议问题