Skip to main content

Magic to display pythontutor.com from a code cell in the IPython notebook.

Project description

IPython magics to embed http://www.pythontutor.com within an IFrame in the IPython notebook using the code from an IPython code cell.

Install

pip install tutormagic

or

pip install git+https://github.com/kikocorreoso/tutormagic.git

Tested on Python 2.7 and Python 3.4 and IPython 3.0.0.

Usage

First, load the extension:

%load_ext tutormagic

Once loaded, in a code cell in the notebook type the following:

%%tutor --lang python3
# some python code
# ...

Options

The only available option is the --lang or -l that allows you to choose one of the available languages supported by pythontutor

  • %%tutor --lang python3 or %%tutor -l python3 or %%tutor to show a pythontutor IFrame with python3 code.

  • %%tutor --lang python2 or %%tutor -l python2 to show a pythontutor IFrame with python2 code.

  • %%tutor --lang java or %%tutor -l java to show a pythontutor IFrame with java code.

  • %%tutor --lang javascript or %%tutor -l javascript to show a pythontutor IFrame with javascript code.

Example (in spanish)

Example notebook.

Name of the extension

The name of the extension was suggested by [@dsblank](https://github.com/dsblank).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tutormagic-0.1.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page