Simpler way to put PDB breakpoints in Python code?

后端 未结 14 2233
不知归路
不知归路 2020-11-30 18:21

Just a convenience question. I\'ve been a bit spoiled with debuggers in IDEs like Visual Studio and XCode. I find it a bit clumsy to have to type import pdb; pdb.set_t

14条回答
  •  日久生厌
    2020-11-30 18:51

    I haven't tried it yet but they just implemented a new built-in called breakpoint() in Python 3.7 which means you can insert a breakpoint with one statement now:

    breakpoint()
    

提交回复
热议问题