Simpler way to put PDB breakpoints in Python code?

后端 未结 14 2209
不知归路
不知归路 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 19:04

    You can use:

    from pdb import set_trace as bp
    
    code
    code
    bp()
    code
    code
    

提交回复
热议问题