On this page
Jupyter Howto
On this page
Jupyter Howto
Display all line outputs in a cell
- Place this code in a Jupyter cell
from IPython.core.interactiveshell import InteractiveShellInteractiveShell.ast_node_interactivity = "all"
- Add
dislplay(variable)
for each variable you want to show. Import fromfrom IPython.display import display
- For permanent effect (or when using Jupyter Lab), add following code to the file
C:\Users\USERNAME\.ipython\profile_default\ipython_config.py
:
c.InteractiveShell.ast_node_interactivity = "all"
or
c = get_config()c.InteractiveShell.ast_node_interactivity = "all"
Debugging
import pdb;pdb.set_trace()
or
!pip install -Uqq ipdbimport ipdbipdb.set_trace()
with
- l(ist) Show the current location in the file
- h(elp) Show a list of commands, or find help on a specific command
- q(uit) Quit the debugger and the program
- d(own) [count] Move the current frame count (default one) levels down in the stack trace (to a newer frame).
- u(p) [count] Move the current frame count (default one) levels up in the stack trace (to an older frame).
- b(reak)
- c(ontinue) Quit the debugger, continue in the program
- n(ext) Go to the next step of the program
- p(rint) Print variables
- s(tep) Step into a subroutine
- r(eturn) Return out of a subroutine
- unt(il) [lineno]
- j(ump) [lineno]
See:
- Debugging in Google Colab notebook
- Blog-Debugging.ipynb - Colaboratory
- 01.06-Errors-and-Debugging.ipynb - Colaboratory
- gotcha/ipdb: Integration of IPython pdb
References
Tags
Edit this page
Last updated on 3/7/2023