Skip to content

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

License

Notifications You must be signed in to change notification settings

tomsimonart/tutormagic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tutormagic extension for the IPython notebook

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/Jupyter 3.x/4.x.

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%