Note: I can't provide technical support for users who want to install Python Tutor on their own computers/servers.
Read details here: https://github.com/pgbovine/OnlinePythonTutor/blob/master/unsupported-features.md
---
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 webpack@v3.11.0 -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
[NB: no longer seems to work as of 2019-06-10]
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
没有合适的资源?快使用搜索试试~ 我知道了~
OnlinePythonTutor-master.zip
共511个文件
png:132个
js:99个
txt:59个
5星 · 超过95%的资源 需积分: 50 19 下载量 71 浏览量
2021-06-25
15:22:45
上传
评论
收藏 24.11MB ZIP 举报
温馨提示
python可视化工具(离线版)
资源详情
资源评论
资源推荐
收起资源包目录
OnlinePythonTutor-master.zip (511个子文件)
fjalar-NestedStructTest.c 2KB
fjalar-string-arrays.c 666B
struct-basic.c 636B
globals.c 522B
array-param.c 496B
pointers-gone-wild.c 455B
string-reverse-inplace.c 423B
meng-thesis-example.c 423B
fjalar-pointer-levels.c 283B
typedef-test.c 274B
array-overflow.c 213B
pointer-chain.c 123B
cpp-class-basic.cpp 2KB
cpp-inheritance.cpp 2KB
cpp-pass-by-ref.cpp 1KB
cpp-class-date.cpp 1KB
cpp-virtual-method.cpp 938B
cpp-class-pointers.cpp 805B
cpp-first.cpp 193B
togetherjs.css 66KB
jquery-ui.css 35KB
jquery-ui.min.css 29KB
jquery-ui-1.8.24.custom.css 21KB
jquery-ui-1.8.21.custom.css 20KB
pytutor.css 19KB
jquery-ui.structure.css 18KB
jquery-ui.theme.css 17KB
jquery-ui.structure.min.css 14KB
jquery-ui.theme.min.css 14KB
jquery.qtip.css 12KB
opt-frontend.css 6KB
holistic.css 3KB
index_2018-03-17.css 3KB
index.css 3KB
opt-live.css 2KB
basic.css 1KB
jquery.ui.chatbox.css 1KB
opt-lessons.css 1KB
composingprograms.css 540B
opt-testcases.css 426B
recorder.css 368B
index.html 31KB
interface.html 29KB
pytutor-embed-demo-simple.html 21KB
index_2018-03-17.html 6KB
iframe-embed-demo.html 6KB
walkthrough.html 5KB
live.html 5KB
visualize.html 3KB
java.html 3KB
index.html 3KB
recorder.html 3KB
pytutor-embed-demo.html 3KB
typescript.html 3KB
javascript.html 3KB
cpp.html 2KB
ruby.html 2KB
c.html 2KB
composingprograms.html 2KB
csc108h_shared.html 2KB
csc108h.html 1KB
recorder.html 1KB
index.html 1KB
test_walkabout.html 1KB
pytutor-c-embed.html 993B
pytutor-oop-embed.html 972B
render-trace.html 898B
test_walkabout_nojquery.html 892B
test_overlap.html 667B
iframe-embed.html 617B
test_random.html 466B
walkabout.html 172B
favicon.ico 15KB
Complex.java 5KB
Person.java 2KB
Rolex.java 1KB
LinkedList.java 1KB
Forest.java 1KB
Synthetic.java 803B
PassByValue.java 624B
StackQueue.java 615B
CmdLineArgs.java 600B
Strings.java 580B
Postfix.java 542B
StdIn.java 542B
LambdaExample.java 541B
Reflect.java 456B
ExceptionFlow.java 449B
Knapsack.java 420B
Exception.java 376B
TwoClasses.java 369B
ControlFlow.java 368B
SymbolTable.java 360B
Sqrt.java 295B
Casting.java 272B
Variables.java 260B
StaticInitializer.java 258B
ToString.java 248B
Recursion.java 216B
StackOverflow.java 168B
共 511 条
- 1
- 2
- 3
- 4
- 5
- 6
anITfish
- 粉丝: 107
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1