What is the right way to debug in iPython notebook?

前端 未结 10 1666
不知归路
不知归路 2020-11-30 16:50

As I know, %debug magic can do debug within one cell.

However, I have function calls across multiple cells.

For example,

In[1]:          


        
10条回答
  •  攒了一身酷
    2020-11-30 17:48

    In Python 3.7 you can use breakpoint() function. Just enter

    breakpoint()
    

    wherever you would like runtime to stop and from there you can use the same pdb commands (r, c, n, ...) or evaluate your variables.

提交回复
热议问题