GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - guangyaw/OPT: online python tutor

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
build
build
 
 
codechella-to-codcast
codechella-to-codcast
 
 
css
css
 
 
example-code
example-code
 
 
js
js
 
 
pytutor-embed-demo
pytutor-embed-demo
 
 
tests/frontend-tests
tests/frontend-tests
 
 
.gitignore
.gitignore
 
 
LIVE_exec_js.py
LIVE_exec_js.py
 
 
LIVE_exec_py2.py
LIVE_exec_py2.py
 
 
LIVE_exec_py3.py
LIVE_exec_py3.py
 
 
README.txt
README.txt
 
 
add_cache_busting_query_strings.py
add_cache_busting_query_strings.py
 
 
audo_load.sh
audo_load.sh
 
 
bottle_server.py
bottle_server.py
 
 
c.html
c.html
 
 
composingprograms.html
composingprograms.html
 
 
cpp.html
cpp.html
 
 
csc108h.html
csc108h.html
 
 
csc108h_shared.html
csc108h_shared.html
 
 
doctest_exec.py
doctest_exec.py
 
 
doctest_reader.py
doctest_reader.py
 
 
doctest_splitter.py
doctest_splitter.py
 
 
error_log.py
error_log.py
 
 
eureka_survey.py
eureka_survey.py
 
 
favicon.ico
favicon.ico
 
 
generate_json_trace.py
generate_json_trace.py
 
 
iframe-embed-demo.html
iframe-embed-demo.html
 
 
iframe-embed.html
iframe-embed.html
 
 
index.html
index.html
 
 
index_2018-03-17.html
index_2018-03-17.html
 
 
java.html
java.html
 
 
javascript.html
javascript.html
 
 
live.html
live.html
 
 
opt_auto.sh
opt_auto.sh
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
pg_encoder.py
pg_encoder.py
 
 
pg_logger.py
pg_logger.py
 
 
pytutor-embed-demo-simple.html
pytutor-embed-demo-simple.html
 
 
pytutor-embed-demo.html
pytutor-embed-demo.html
 
 
recorder.html
recorder.html
 
 
render-trace.html
render-trace.html
 
 
ruby.html
ruby.html
 
 
runtime_err_survey.py
runtime_err_survey.py
 
 
syntax_err_survey.py
syntax_err_survey.py
 
 
tsconfig.json
tsconfig.json
 
 
tsd.json
tsd.json
 
 
typescript.html
typescript.html
 
 
visualize.html
visualize.html
 
 
viz_interaction.py
viz_interaction.py
 
 
web_exec_c.py
web_exec_c.py
 
 
web_exec_cpp.py
web_exec_cpp.py
 
 
web_exec_java.py
web_exec_java.py
 
 
web_exec_js.py
web_exec_js.py
 
 
web_exec_py2.py
web_exec_py2.py
 
 
web_exec_py3.py
web_exec_py3.py
 
 
web_exec_py3anaconda.py
web_exec_py3anaconda.py
 
 
web_exec_ruby.py
web_exec_ruby.py
 
 
web_exec_ts.py
web_exec_ts.py
 
 
webpack.config.js
webpack.config.js
 
 

Repository files navigation

If you are looking for the original OnlinePythonTutor, please don't download this one.
Because it has been modified for Guangyaw's project .

The original code on github:
https://github.com/pgbovine/OnlinePythonTutor

====================================================
Quick install:

pip install bottle # make sure the bottle webserver (http://bottlepy.org/) is installed
cd OPT
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


====================================================

Online Python Tutor v5 "unity" -- the goal for this version is to
significantly clean up, modernize, and modularize the OPT codebase to
ease future development.

Specifically, this version of the codebase improves upon the older v3/
code by using TypeScript and refactoring the code for better modularity.
To see how, compare the TypeScript files found here in js/ and the older
messier JavaScript files in ../v3/js/

The main caveat, though, is that there's the extra complexity of a
Webpack- and TypeScript-based compilation step. See these files for more
info:

- package.json      <-- Node.js dependencies for npm
- package-lock.json <-- see https://docs.npmjs.com/files/package-locks
- webpack.config.js <-- Webpack configuration file (works on webpack versions under v4)

Note that this directory (like v3/) contains only the web frontend code
and the Python execution backend (mainly in pg_logger.py). For the
backends that run *other* (i.e., non-Python) languages, see
../v4-cokapi/

---
After everything has been installed properly (see below):

To start the Webpack automatic file watching and code compilation
environment, run:

  npm run webpack


To start the webserver, run:

  npm start

then visit here to load an HTML page in your browser:
  http://localhost:8003/visualize.html

To make a production (minified, cache-busted) build for deployment, run:

  npm run production-build


(TODO: the --optimize-minimize doesn't seem to work right now; dunno why, ergh)
---
This workflow was tested on 2017-02-11 with these versions of major tools:

typescript 2.1.6
webpack 2.2.1


UPDATE: it was tested on 2018-05-26 with:

$ webpack -v
3.11.0

$ tsc -v
Version 2.8.3

------

[instructions last updated on 2018-05-26 ... ergh these instructions
get outdated so quickly since the npm ecosystem is so unstable and moves
so fast ...]

To get started, install:

1) Node.js / npm
2) Global npm dependency installs (run these commands in this directory):

  sudo npm install [email protected] -g # DON'T USE NEWER WEBPACK since it won't work with my webpack.config.js file, ergh
  sudo npm install webpack-dev-server -g
  sudo npm install -g typescript
  sudo npm install -g tsd

3) Run "npm install" in this directory to install node dependencies
4) Run "tsd install" in this directory to install TypeScript definition files

5) do this near the end, i think
  npm link webpack            # link to the local node_modules/ dir
  npm link typescript         # link to the local node_modules/ dir

6) Install bottle.py to run the local webserver (I suppose we could use node too, but oh wells!)
  pip install bottle # maybe needed sudo

see package.json for specific version dependencies, such as:
    "ts-loader": "^3.5.0",
otherwise stuff doesn't play well together, eeeek dependency hell!

======
History:

I started porting v3/ over to v5-unity/ on 2016-06-12 since the headache
of manually maintaining so many JS/CSS files and their intricate
dependencies was starting to get out of hand ... i've waited for years
to port to a more sustainable and modern development setup ...

I decided to go with Webpack for the module system and to upgrade the
appropriate versions of libraries to match, without breaking crufty
legacy code (hopefully)


======
Older (possibly-outdated) notes from mid-2016:

Requires these global installations:
- Node.js / npm
- webpack: http://webpack.github.io/ and webpack-dev-server
  sudo npm install webpack -g
  sudo npm install webpack-dev-server -g

  [you might need to install webpack locally (without the -g) ... weird]

If you run: webpack-dev-server --progress --colors

then your code will automatically recompile and be refreshed here:
http://localhost:8080/webpack-dev-server/visualize.html
(but this is kinda flaky, ugh)

Instead, use this to continually compile:
webpack --watch

and run the server with Bottle:
python bottle_server.py

---
Ported the code base over to TypeScript for enhanced static checking

For developing using TypeScript:
  sudo npm install -g typescript # install globally
  npm link typescript            # link to the local node_modules/ dir
  npm install tsd -g             # tsd type definitions manager
  tsd install require --save
  tsd install jQuery --save
  tsd install jquery.bbq --save
  tsd install ace --save
  tsd install qtip2 --save
  tsd install jqueryui --save
  tsd install d3 --save
  tsd install diff-match-patch --save
  tsd install jquery.simplemodal --save

  (then in the future, simply run 'tsd install' to install definition
   modules saved in tsd.json)

Currently using: Version 1.8.10

About

online python tutor

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.