|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | +<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | + |
| 4 | +<!-- |
| 5 | +
|
| 6 | +Online Python Tutor |
| 7 | +Copyright (C) 2010 Philip J. Guo (philip@pgbovine.net) |
| 8 | +https://github.com/pgbovine/OnlinePythonTutor/ |
| 9 | +
|
| 10 | +This program is free software: you can redistribute it and/or modify |
| 11 | +it under the terms of the GNU General Public License as published by |
| 12 | +the Free Software Foundation, either version 3 of the License, or |
| 13 | +(at your option) any later version. |
| 14 | +
|
| 15 | +This program is distributed in the hope that it will be useful, |
| 16 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | +GNU General Public License for more details. |
| 19 | +
|
| 20 | +You should have received a copy of the GNU General Public License |
| 21 | +along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | +
|
| 23 | + --> |
| 24 | + |
| 25 | + |
| 26 | +<head> |
| 27 | + <title>Online Python Tutor: Write Python code online and single-step through its execution</title> |
| 28 | + |
| 29 | +<!-- jQuery 1.6.0 --> |
| 30 | + |
| 31 | +<!-- local version for offline testing --> |
| 32 | +<script type="text/javascript" src="jquery.min.js"></script> |
| 33 | + |
| 34 | +<!-- online version hosted by Google --> |
| 35 | +<!-- |
| 36 | + <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script> |
| 37 | + --> |
| 38 | + |
| 39 | + |
| 40 | +<!-- load these local files only when localTesting == true |
| 41 | +
|
| 42 | +<script type="text/javascript" src="mock-data.js"></script> |
| 43 | +
|
| 44 | +--> |
| 45 | + |
| 46 | +<script type="text/javascript" src="jquery.textarea.js"></script> |
| 47 | + |
| 48 | +<!-- disable autogrow for simplicity |
| 49 | + <script type="text/javascript" src="jquery.autogrow.js"></script> |
| 50 | + --> |
| 51 | + |
| 52 | +<!-- jsPlumb library for rendering connectors --> |
| 53 | +<script type="text/javascript" src="jquery.jsPlumb-1.3.3-all-min.js "></script> |
| 54 | + |
| 55 | +<!-- my own code --> |
| 56 | +<script type="text/javascript" src="edu-python.js"></script> |
| 57 | +<script type="text/javascript" src="edu-python-tutor.js"></script> |
| 58 | + |
| 59 | +<link rel="stylesheet" href="edu-python.css"/> |
| 60 | + |
| 61 | +</head> |
| 62 | + |
| 63 | +<body> |
| 64 | + |
| 65 | +<div id="pyInputPane"> |
| 66 | + |
| 67 | +Write your Python code here: |
| 68 | +<br/> |
| 69 | + |
| 70 | +<textarea class="codeInputPane" id="pyInput" cols="55" rows="20" wrap="off"></textarea> |
| 71 | + |
| 72 | +<p> |
| 73 | + |
| 74 | +<button id="executeBtn" class="bigBtn" type="button">Visualize execution</button> |
| 75 | + |
| 76 | +</p> |
| 77 | + |
| 78 | +<p style="margin-top: 25px;">Try these small examples:<br/> |
| 79 | + |
| 80 | +<a id="aliasExampleLink" href="#">aliasing</a> | |
| 81 | +<a id="tutorialExampleLink" href="#">intro</a> | |
| 82 | +<a id="factExampleLink" href="#">factorial</a> | |
| 83 | +<a id="fibonacciExampleLink" href="#">fibonacci</a> | |
| 84 | +<a id="memoFibExampleLink" href="#">memoized fib</a> | |
| 85 | +<a id="newtonExampleLink" href="#">square root</a> | |
| 86 | +<a id="insSortExampleLink" href="#">insertion sort</a> |
| 87 | +<br/> |
| 88 | +<a id="filterExampleLink" href="#">filter</a> | |
| 89 | +<a id="strtokExampleLink" href="#">tokenize</a> | |
| 90 | +<a id="oopSmallExampleLink" href="#">OOP</a> | |
| 91 | +<a id="pwGcdLink" href="#">gcd</a> | |
| 92 | +<a id="pwSumListLink" href="#">sumList</a> | |
| 93 | +<a id="towersOfHanoiLink" href="#">towers of hanoi</a> | |
| 94 | +<a id="pwTryFinallyLink" href="#">exceptions</a> |
| 95 | + |
| 96 | +</p> |
| 97 | + |
| 98 | +<p style="margin-top: 25px;">Examples from the MIT |
| 99 | +<a href="http://mit.edu/6.01/">6.01</a> course:<br/> |
| 100 | + |
| 101 | +<a id="mapExampleLink" href="#">list map</a> | |
| 102 | +<a id="sumExampleLink" href="#">summation</a> | |
| 103 | +<a id="oop1ExampleLink" href="#">OOP 1</a> | |
| 104 | +<a id="oop2ExampleLink" href="#">OOP 2</a> | |
| 105 | +<a id="inheritanceExampleLink" href="#">inheritance</a> |
| 106 | + |
| 107 | +</p> |
| 108 | + |
| 109 | +</div> |
| 110 | + |
| 111 | + |
| 112 | +<table border="0" id="pyOutputPane"> |
| 113 | +<tr> |
| 114 | +<td valign="top"> |
| 115 | + |
| 116 | +<center> |
| 117 | + |
| 118 | +<div id="pyCodeOutputDiv"> |
| 119 | + |
| 120 | +Use left and right arrow keys to step through this code: |
| 121 | +<table id="pyCodeOutput"></table> |
| 122 | + |
| 123 | +</div> |
| 124 | + |
| 125 | +<div id="editCodeLinkDiv"> |
| 126 | + |
| 127 | +<button id="editBtn" class="medBtn" type="button">Edit code</button> |
| 128 | + |
| 129 | +</div> |
| 130 | + |
| 131 | +<div id="vcrControls"> |
| 132 | + <button id="jmpFirstInstr", type="button"><< First</button> |
| 133 | + <button id="jmpStepBack", type="button">< Back</button> |
| 134 | + <span id="curInstr">Step ? of ?</span> |
| 135 | + <button id="jmpStepFwd", type="button">Forward ></button> |
| 136 | + <button id="jmpLastInstr", type="button">Last >></button> |
| 137 | +</div> |
| 138 | + |
| 139 | +<div id="errorOutput"></div> |
| 140 | + |
| 141 | + |
| 142 | +</center> |
| 143 | + |
| 144 | +Program output: |
| 145 | +<br/> |
| 146 | +<textarea id="pyStdout" cols="50" rows="13" wrap="off" readonly></textarea> |
| 147 | + |
| 148 | + |
| 149 | +</td> |
| 150 | +<td valign="top"> |
| 151 | + |
| 152 | +<div id="dataViz"></div> |
| 153 | + |
| 154 | +</td> |
| 155 | +</tr> |
| 156 | +</table> |
| 157 | + |
| 158 | +<center> |
| 159 | + |
| 160 | + |
| 161 | +<div id="footer"> |
| 162 | + |
| 163 | +<input type="checkbox" id="classicModeCheckbox"/> Use low-bandwidth mode (for older browsers) |
| 164 | + |
| 165 | +<p/> |
| 166 | +This application supports the core <a |
| 167 | +href="http://www.python.org/doc/2.5/">Python 2.5</a> language, with no |
| 168 | +module imports or file I/O. It's meant to be used as a platform for |
| 169 | +creating programming tutorials, not for running or debugging |
| 170 | +production code. |
| 171 | + |
| 172 | +<p style="margin-top: 8px;"/>Official Python 3 support is coming soon; |
| 173 | +for now, try the <a |
| 174 | +href="http://netserv.ict.ru.ac.za/python3_viz/">Python 3 fork</a> by |
| 175 | +Peter Wentworth. |
| 176 | + |
| 177 | +<p style="margin-top: 8px;"/> |
| 178 | +Check out the <a |
| 179 | +href="https://github.com/pgbovine/OnlinePythonTutor/">GitHub</a> |
| 180 | +repository and send bug reports, feedback, and suggestions to philip@pgbovine.net |
| 181 | + |
| 182 | +<p style="margin-top: 8px;"/> |
| 183 | +Copyright © 2010-2011 <a href="http://www.stanford.edu/~pgbovine/">Philip J. Guo</a> |
| 184 | +</div> |
| 185 | + |
| 186 | +</center> |
| 187 | + |
| 188 | +</body> |
| 189 | +</html> |
| 190 | + |
0 commit comments