Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Online Python Tutor

DZone's Guide to

Online Python Tutor

· Web Dev Zone
Free Resource

Try RAD Studio for FREE!  It’s the fastest way to develop cross-platform Native Apps with flexible Cloud services and broad IoT connectivity. Start Your Trial Today!

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:


Learn

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



Solve

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.




Debug


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

Optimize

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."

Create

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.

Get Your Apps to Customers 5X Faster with RAD Studio. Brought to you in partnership with Embarcadero.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}