You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fa41f94
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: v3/docs/developer-overview.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ Look at the Git history to see when this document was last updated; the more tim
7
7
elapsed since that date, the more likely things are out-of-date. Please email
8
8
philip@pgbovine.net if you have questions.
9
9
10
+
And please excuse the sloppy writing; I'm not trying to win any style awards here :)
11
+
10
12
11
13
## Running OPT locally on your machine
12
14
@@ -19,11 +21,22 @@ for your OS and then run:
19
21
20
22
Now if you visit http://localhost:8080/ on your browser, you should see the main OPT editor screen.
21
23
22
-
Congrats! Now you can edit your code and reload the page to test your changes. You don't need to shut down and restart
23
-
the local webserver after every edit.
24
+
Congrats! Now you can edit any code in `OnlinePythonTutor/v3/`and reload the page to test your changes.
25
+
You don't need to shut down and restart the local webserver after every edit.
24
26
25
27
The main caveat here is that Google App Engine runs Python 2.7, so you won't be able to test Python 3 locally this way.
26
28
27
29
28
30
## Overall system architecture
29
31
32
+
OPT consists of a pure-Python backend and an HTML/CSS/JavaScript frontend. All of the relevant files are located in `OnlinePythonTutor/v3/`, since v3 is the currently active version.
33
+
34
+
Here is a typical user interaction sequence:
35
+
36
+
1. The user types in Python code in the editor (powered by [CodeMirror](http://www.codemirror.net/)).
37
+
2. The user hits the "Visualize execution" button.
38
+
3. The OPT frontend sends the user's Python code as a string to the backend by making an AJAX GET request.
39
+
4. The backend executes the Python code under the supervision of the Python [bdb](http://docs.python.org/library/bdb.html) debugger module, produces an execution trace, and send that trace back to the frontend.
40
+
5. The frontend switches to a visualization pane, parses the execution trace, and renders the appropriate stack frames and heap objects.
41
+
6. When the user interacts with the frontend by stepping through execution points (forwards and backwards), the frontend renders the proper data structures WITHOUT making another call to the backend.
0 commit comments