Skip to content

Visualize Python, Java, JavaScript, TypeScript, Ruby, C, and C++ code execution on UNCode. This is provided as a Docker service on UNCode to allow students to visualize their code and help them to find the solution.

License

Notifications You must be signed in to change notification settings

JuezUN/OnlinePythonTutor

 
 

Repository files navigation

Python tutor - UNCode

GitHub license Codacy Badge CLA assistant Gitter

Python Tutor helps people overcome a fundamental barrier to learning programming: understanding what happens as the computer executes each line of a program's source code. Using this tool, you can write Python, Java, JavaScript, TypeScript, Ruby, C, and C++ programs in your Web browser and visualize what the computer is doing step-by-step as it executes those programs.

This repository makes some small modifications to the original code to provide it as a Docker service to embed the interface on UNCode and allow users to visualize their code in Python3, C/C++ and Java.

The container is deployed in Docker Hub: unjudge/onlinepythontutor.

The official website of the project is: http://pythontutor.com/.

This tool was created by Philip Guo in January 2010. See project history.

Documentation

To view all documentation related to this project check the docs. For additional documentation, please refer to the Wiki.

Getting started

As this repository in only focused on supporting this utility for UNCode, there are two options to deploy and embed this on UNCode. This integration is also done in the organization main repository, in the multilang plugin.

Check the iframe embedding documentation for a better understanding on how this works.

However, it can be hard to run your own visualizer locally for non-Python languages, since it is necessary to deploy a service called cokapi, check the documentation. This service also needs a backend to run C/C++ code, this is located in the repository opt-cpp-backend.

To understand more how to deploy this service, check this script, which automatically deploys it when UNCode is deployed automatically.

For further directions, see Overview for Developers or explore the rest of the docs.

Running container

To run the container, you can either pull it from docker hub:

docker pull unjudge/onlinepythontutor

Or build it:

docker build -t unjudge/onlinepythontutor ./
docker run -p 8003:8003 -e PY_CMD=python3 unjudge/onlinepythontutor 

To visualize python 2.7 code, run the container using the environment variable PY_CMD with python, rather than python3.

You should see the visualizer at: http://localhost:8003/visualize.html

Running locally

If you want to run locally on your own computer, to run Python visualizations try:

pip install bottle # make sure the bottle webserver (http://bottlepy.org/) is installed
cd OnlinePythonTutor/v3/
python bottle_server.py

You should see the visualizer at: http://localhost:8003/visualize.html and the live programming environment at: http://localhost:8003/live.html

Roadmap

See the UNCode GitHub Project for a list of proposed features for UNCode, known issues and how they are being tackled.

Contributing

Go to CONTRIBUTING to see the guidelines and how to start contributing to UNCode.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

In case of technical questions, please use the gitter communication channel.

In case you want to host your course on our deployment, email us on: [email protected]

UNCode: https://uncode.unal.edu.co

Project page: https://juezun.github.io/

Acknowledgments

For code or security contributions

  • John DeNero - for helping with the official Python 3 port and lots of code patches
  • Chris Horne - https://github.com/lahwran - for security tips
  • Joshua Landau - [email protected] - for security tips
  • David Wyde - https://davidwyde.com/ - for security tips
  • Peter Wentworth and his students - for working on the original Python 3 fork circa 2010/2011
  • Brad Miller - for adding pop-up question dialogs to visualizations, and other bug fixes
  • David Pritchard and Will Gwozdz - for the Java visualizer and other frontend enhancements
  • Peter Robinson - for v3/make_visualizations.py
  • Chris Meyers - for custom visualizations such as v3/matrix.py and v3/htmlFrame.py
  • Irene Chen - for holistic visualization mode -- v3/js/holistic.js

For general advice and feedback about this project:

  • Ned Batchelder
  • Jennifer Campbell
  • John Dalbey
  • John DeNero
  • Fredo Durand
  • Michael Ernst
  • David Evans
  • Paul Gries
  • Mark Guzdial
  • Adam Hartz
  • Sean Lip

... and many, many more!

About

Visualize Python, Java, JavaScript, TypeScript, Ruby, C, and C++ code execution on UNCode. This is provided as a Docker service on UNCode to allow students to visualize their code and help them to find the solution.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 61.3%
  • Java 9.3%
  • HTML 6.8%
  • TypeScript 6.4%
  • Python 5.6%
  • CSS 4.0%
  • Other 6.6%