Skip to main content

Nbtutor

Visualize Python code execution (line-by-line) in Jupyter Notebook cells. Inspired by Online Python Tutor

Usage Example

Binder

Install

Note: installing directly off this repo won't work, as we don't ship the built JavaScript and CSS assets. See more about developing below.

pip

pip install nbtutor
jupyter nbextension install --overwrite --py nbtutor
jupyter nbextension enable --py nbtutor

conda

conda install -c conda-forge nbtutor
jupyter nbextension install --overwrite --py nbtutor
jupyter nbextension enable --py nbtutor

Usage (Jupyter Notebook)

First load the nbtutor IPython kernel extension at top of the Notebook by executing the following magic in a CodeCell:

%load_ext nbtutor

Then to visualize the execute of code in a CodeCell add the following magic to the top of the CodeCell and execute it again:

%%nbtutor

Optional Arguments

There are also optional arguments that can be used with the cell magic:

  • Reset the IPython user namespace

    %%nbtutor -r/--reset
    
  • Suppress the confirmation message from -r/--reset

    %%nbtutor -r/--reset -f/--force
    
  • Specify the maximum frame depth to visualize (default: 3)

    %%nbtutor -d/--depth N
    
  • Specify the maximum number of elements to visualize for "sequence" type objects (default: 5)

    %%nbtutor --max_size S
    
  • Step through all frames (including frames from other cells and other global scopes altogether)

    %%nbtutor --step_all
    

Notes

  • If you find a problem please feel free to submit a GitHub Issue

Develop

Please see the DEVELOPMENT.md file

Metadata

Release files for nbtutor 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nbtutor 2.0.3
File Size Uploaded
nbtutor-2.0.3.tar.gz 618.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nbtutor 2.0.3
File Interpreter ABI Platform
nbtutor-2.0.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 809.3 kB

Release files / nbtutor-2.0.3.tar.gz

Download URL nbtutor-2.0.3.tar.gz
Size 618.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9b02ed69e39c1240055bec07cd0b902dd10d3332786c2f913e041538b312563d
BLAKE2b-256 checksum
How to use checksums
d41ddb9ce929a20abf5d7a1a234d83847314f9ccc84d67af05315a64f4be7937
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.2

Release files / nbtutor-2.0.3-py2.py3-none-any.whl

Download URL nbtutor-2.0.3-py2.py3-none-any.whl
Size 190.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6ac8101ea5fcc4b67b44b1c2b28df6ab7223fd78f1459bc632692bd574680993
BLAKE2b-256 checksum
How to use checksums
21341eea3231a2a15768a744a8af7f2c2023905d0f6d76ba54aee3be58e0ec21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page