Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MistofThunder27/OnlinePythonTutor_Python3_local

 
 

Repository files navigation

Truncated original author message: ---------------------------------------
Online Python Tutor
Copyright (C) 2010 Philip J. Guo ([email protected])
https://github.com/pgbovine/OnlinePythonTutor/

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------

The full version of the original author message is in readme_original.
This version of the repository has been updated to python 3 and is being
changed significantly to work exclusively as a standalone program running
on a custom local python server. This is part of a personal project and
so changes made will prioritize specific use cases over general ones.

This repository was forked on Github from hcientist/OnlinePythonTutor
This program remains under the GNU General Public License version 3


Introduction:
This program a web application running on a local server where you can
type Python scripts directly into your web browser, execute those scripts,
and single-step and multiple-step FORWARDS AND BACKWARDS through
execution in order to view the run-time state of all data structures.

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.

Try the original live version at: http://www.onlinepythontutor.com/

======
System architecture overview:

This program is implemented as a web application, with a
JavaScript front-end making AJAX calls to a pure-Python back-end.

The back-end is a python 3 local server, while the front-end
is HTML/JavaScript (using the jQuery library). It's
responsible for the input text box, submitting the Python code (as
plaintext) to the back-end, receiving an execution trace from the
back-end, and then rendering that trace as data structure
visualizations. The front-end code resides in these files in the
front_end directory:

 tutor.html
 question.html
 edu-python.js
 edu-python-tutor.js
 edu-python-questions.js
 edu-python.css
 jquery.textarea.js

 (there are also other 3rd-party JavaScript library files)

The back-end is a local python 3 server that uses the http.server module
it executes the entire script (up to a customisable 200 executed
lines, to prevent infinite loops), and collects a full trace of all
variable values (i.e., data structures) after each line has been
executed. It then sends that full trace to the front-end in a
specially-encoded JSON format. The front-end then parses and visualizes
that trace and allows the user to single-step forwards AND backwards
through execution.

The back-end includes main.py and m_pg_logger.py files:

  main.py                       - manage the local server
  m_pg_logger.py                - the 'meat' of the back-end

About

Learn Python by executing code and visualizing data structures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 49.6%
  • Python 29.3%
  • HTML 11.0%
  • CSS 10.1%