Skip to content

Commit 41319bc

Browse files
author
Philip Guo
committed
polish
1 parent 8008748 commit 41319bc

1 file changed

Lines changed: 26 additions & 24 deletions

File tree

‎README‎

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
Introduction:
2020

2121
The Online Python Tutor is a web application where you can type Python
22-
scripts directly in your web browser, execute those scripts, and
22+
scripts directly into your web browser, execute those scripts, and
2323
single-step FORWARDS AND BACKWARDS through execution in order to view
24-
the state of run-time data.
24+
the run-time state of all data structures.
2525

26-
Using this application, teachers and students can write small Python
27-
code snippets together and see what happens to the data structures when
28-
the code gets executed.
26+
Using this tool, teachers and students can write small Python code
27+
snippets together and see what happens to the data structures when the
28+
code gets executed.
2929

3030
Try it out live at: http://people.csail.mit.edu/pgbovine/python/
3131

@@ -38,16 +38,16 @@ JavaScript front-end making AJAX calls to a pure-Python back-end.
3838
The back-end has been tested on an Apache server running Python 2.5
3939
through CGI. Note that it will probably fail in subtle ways on other
4040
Python 2.X (and will DEFINITELY fail on Python 3.X). Peter Wentworth
41-
has create a port to Python 3.X, and hopefully we can soon integrate his
42-
code into my repository.
41+
has create a port to Python 3.X, and hopefully we can eventually
42+
integrate his code into my repository.
4343

4444

45-
The front-end is HTML/javascript (using the jQuery library). It's
45+
The front-end is HTML/JavaScript (using the jQuery library). It's
4646
responsible for the input text box, submitting the Python code (as
4747
plaintext) to the back-end, receiving an execution trace from the
4848
back-end, and then rendering that trace as data structure
49-
visualizations. The front-end code is publicly available in these 5
50-
files in the current directory:
49+
visualizations. The front-end code resides in these files in the
50+
current directory:
5151

5252
index.html
5353
edu-python.js
@@ -56,16 +56,16 @@ files in the current directory:
5656
jquery.textarea.js
5757

5858

59-
The back-end is a server-side app that takes Python script source code
60-
as input, executes the entire script (up to 100 executed lines, to
61-
prevent infinite loops), and collects a full trace of all variable
62-
values (i.e., data structures) after each line is executed. It then
63-
sends that complete trace to the front-end in an encoded JSON format.
64-
The front-end then parses that trace, which is how it's able to
65-
single-step forwards AND backwards through execution.
59+
The back-end is a server-side CGI application that takes Python script
60+
source code as input, executes the entire script (up to 100 executed
61+
lines, to prevent infinite loops), and collects a full trace of all
62+
variable values (i.e., data structures) after each line has been
63+
executed. It then sends that full trace to the front-end in a
64+
specially-encoded JSON format. The front-end then parses and visualizes
65+
that trace and allows the user to single-step forwards AND backwards
66+
through execution.
6667

67-
The back-end files reside in the cgi-bin/ sub-directory in this
68-
repository:
68+
The back-end resides in the cgi-bin/ sub-directory in this repository:
6969

7070
cgi-bin/web_exec.py - the CGI entrance point to the back-end
7171
cgi-bin/pg_logger.py - the 'meat' of the back-end
@@ -83,16 +83,18 @@ deployed on the same server (unless you do some fancy proxy magic).
8383

8484

8585
======
86-
Original vision (from January 2010):
86+
Original founding vision (from January 2010):
8787

8888
I want to create a web-based interactive learning platform for students
8989
to explore programming. I envision an HTML UI where a student can enter
9090
in code and then single-step through it and see how the data structures
9191
change during execution.
9292

93-
I realized that for the small programs that students write, it might be
94-
possible to simply LOG all execution (and data structures) and then we
95-
can simply play it back with single-step forwards and also BACKWARDS
93+
Key insight: I realized that for the small programs that teachers and
94+
students write for educational purposes, it's possible to simply LOG
95+
everything that happens to data structures during execution. Then we
96+
can simply play back that log in the front-end, which allows
97+
single-stepping forwards and also BACKWARDS.
9698

9799
After all, we don't need students to be able to interactive probe and
98100
make changes in the middle of execution, which is the only value-added
@@ -105,7 +107,7 @@ What kinds of things do we want to log?
105107
- all data created by the program
106108

107109
Also log calls and returns of a student's function
108-
(NOT library functions)
110+
(but NOT library functions)
109111

110112
We can use the Python JSON module to encode data structures in JSON and
111113
send it to the client's web browser

0 commit comments

Comments
 (0)