Over a million developers have joined DZone.

Online Python Tutor

DZone's Guide to

Online Python Tutor

· Web Dev Zone ·
Free Resource

Jumpstart your Angular applications with Indigo.Design, a unified platform for visual design, UX prototyping, code generation, and app development.

Philip J. Guo, a Stanford Computer Science Ph.D. student and Python enthusiast, published an online Python tutor that allows the user to type Python scripts into a web browser, execute them, and the user can view the run-time state of the data structures by single-stepping forwards and backwards.

Using this tool, teachers and students can write small Python code snippets together and see what happens to the data structures when the code gets executed.

-- Philip J. Guo

While the application uses a HTML/JavaScript front-end, the back-end is "pure-Python", and the two communicate through AJAX calls.  The application supports Python 2.5 through CGI, but is prone to fail on other Python 2.X and does not support Python 3.X.

The application has five main goals:


"The Online Python Tutor provides a rich visualization of variables, heap objects, and stack frames" as a HTML diagram, properly displaying aliasing relationships.


By providing a web-based interface where users can write solutions and test codes, the Online Python Tutor allows users to practice programming problems similar to those they would face in the real world and know immediately whether or not their coding was correct, and how to fix incorrect code.


Using the Online Python Tutor's bidirectional single-stepping and data structure visualization capabilities, students can practice debugging, an important skill which is rarely covered in web-based programming problems.

-- Philip J. Guo


Students can refactor already-correct programs to improve run speed and reduce instructions.  This allows them to work on problems like, "Optimize this program so that it terminates correctly after running less than 50 line of Python code."


The Tutor offers a "Create" feature that allows teaches to easily create practice problems through a lightweight plain text format.

I plan to add support for semantic constraints like 'don't allow the program to create any auxiliary data structures', which could be used for problems like 'merge these two lists in-place without creating any new temporary lists'.

-- Philip J. Guo

Learn more about the Online Python Tutor.

Take a look at an Indigo.Design sample application to learn more about how apps are created with design to code software.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}