@@ -24,7 +24,13 @@ Now if you visit http://localhost:8080/ on your browser, you should see the main
2424Congrats! Now you can edit any code in ` OnlinePythonTutor/v3/ ` and reload the page to test your changes.
2525You don't need to shut down and restart the local webserver after every edit.
2626
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.
27+ btw, using the default configuration, http://localhost:8080/ is actually loading the ` v3/visualize.html ` HTML file.
28+ (See ` v3/pythontutor.py ` for details.)
29+
30+ The benefit of running OPT locally is that you can test all changes without going online. So even
31+ if you're eventually going to deploy NOT on Google App Engine, it makes good sense to install locally
32+ for development and testing. The main caveat here is that Google App Engine currently runs Python 2.7,
33+ so you won't be able to test Python 3 locally this way.
2834
2935
3036## Overall system architecture
@@ -47,10 +53,18 @@ The frontend consists of:
4753 js/opt-frontend.js
4854 css/pytutor.css
4955 js/pytutor.js
50- <a bunch of auxiliary css and js files such as libraries, etc.>
56+ <a bunch of auxiliary css and js files such as libraries >
57+
58+ ` pytutor.[js|css] ` contain the bulk of the OPT frontend code. In theory, if you set things up correctly,
59+ you should be able to ** embed** an OPT visualization into any webpage with one line of JavaScript that looks like:
60+
61+ var v = new ExecutionVisualizer(domRoot, traceFromBackend, optionalParams);
62+
63+ Thus, the design of ` pytutor.[js|css] ` is meant to be as modular as possible, which means abstracting
64+ everything in an ` ExecutionVisualizer ` object. This way, you can create multiple visualizer objects
65+ to embed on the same webpage and not have them interfere with one another.
5166
52- ` pytutor.[js|css] ` contains the bulk of the OPT frontend code.
53- ` opt-frontend.[js|css] ` contains code that is specific to ` visualize.html ` and doesn't make sense for, say,
67+ ` opt-frontend.[js|css] ` contain code that is specific to the ` visualize.html ` page and doesn't make sense for, say,
5468embedding OPT visualizations into other types of webpages.
5569
5670The backend consists of:
@@ -61,4 +75,3 @@ The backend consists of:
6175 app.yaml and pythontutor.py : config files for Google App Engine
6276 web_exec.py : example CGI script for deploying on CGI-enabled webservers
6377
64- bah
0 commit comments