What is the right way to debug in iPython notebook?

前端 未结 10 1686
不知归路
不知归路 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:49

    Just type import pdb in jupyter notebook, and then use this cheatsheet to debug. It's very convenient.

    c --> continue, s --> step, b 12 --> set break point at line 12 and so on.

    Some useful links: Python Official Document on pdb, Python pdb debugger examples for better understanding how to use the debugger commands.

    Some useful screenshots:

提交回复
热议问题