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 cd6e78f
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -9,9 +9,9 @@ Email philip@pgbovine.net if you're interested in working on anything here, or i
9
9
project ideas.
10
10
11
11
12
-
# Stylistic
12
+
##Stylistic
13
13
14
-
## Beautiful print-outs of OPT visualizations
14
+
###Beautiful print-outs of OPT visualizations
15
15
16
16
A lot of instructors want to print out their OPT visualizations to make handouts or lecture notes
17
17
for students.
@@ -26,7 +26,7 @@ Another idea is to get OPT to output SVG, PDF, or another
26
26
printer-friendly format.
27
27
28
28
29
-
## Responsive web UI design for OPT frontend
29
+
###Responsive web UI design for OPT frontend
30
30
31
31
This is a good project for someone interested in visual and web design.
32
32
@@ -35,9 +35,9 @@ so that OPT visualizations (and the surrounding user interface) look good on dis
35
35
ranging from smartphones to tablets to laptops to giant desktop monitors.
36
36
37
37
38
-
# Frontend
38
+
##Frontend
39
39
40
-
## Rich user input widgets
40
+
###Rich user input widgets
41
41
42
42
Right now Online Python Tutor takes only code as input. However, it would be great to create widgets that allow
43
43
the user to input data into their code. That way, they can visualize the same code executing on different data
@@ -55,7 +55,7 @@ Here are some examples of input widgets:
55
55
- A text box that represents a file on the filesystem. Imagine a web-based I/O simulator where there would be a text box simulating a file object, and then I/O calls such as open, readline, etc. would be intercepted and visualized as iterating (pointing) to the file object one line at a time, reading each line into a string, etc. Writing into a file can also be visualized in this way too. And seeking, overwriting, appending, etc.
56
56
57
57
58
-
## Custom data structure visualizations
58
+
###Custom data structure visualizations
59
59
60
60
Right now Online Python Tutor can render only basic Python data structures.
61
61
@@ -83,7 +83,7 @@ There are (at least) two main ways to implement this feature:
83
83
The dream is to be able to write Python modules for each custom data type.
84
84
85
85
86
-
## Custom Rendering API and Lightweight Plug-In System
86
+
###Custom rendering API and plugin system
87
87
88
88
Right now Online Python Tutor renders Python data structures in a single, fixed way.
89
89
However, different instructors have different preferences for how they want certain objects to render
@@ -98,7 +98,7 @@ The ultimate goal here is to completely replace one-off custom algorithm visuali
98
98
and ad-hoc PowerPoint slide deck animations of CS concepts.
99
99
100
100
101
-
## Annotations for simplifying visualizations
101
+
###Annotations for simplifying visualizations
102
102
103
103
Right now OPT visualizes "everything" about program execution. However, that can easily lead to visual overload.
104
104
Let's think about implementing annotations to selectively show/hide different parts of execution, so that instructors
@@ -123,10 +123,12 @@ lying around.
123
123
Think about how annotations can "clean up" such a big and hairy visualization.
124
124
125
125
126
-
## Authoring environment for programming exercises and quizzes
126
+
###Authoring environment
127
127
128
+
With a proper authoring environment,
128
129
Online Python Tutor visualizations could become a basis for annotated examples, programming exercises, and quizzes.
129
130
131
+
130
132
**Annotated code visualizations**:
131
133
132
134
- Teachers to use as a place to put their code examples and mini-lessons (so that they’re persistent, rather than sending out a bunch of gross URLs)
@@ -146,79 +148,10 @@ and the user would need to fill in those slots with the appropriate values. (The
146
148
not-yet-documented prototype of these sorts of pop-up questions, done by Brad Miller.)
147
149
148
150
149
-
# Backend
150
-
151
-
## Offline mode for use as a production debugger
152
-
153
-
From a reader comment: "As a teaching tool it is invaluable, not only for teaching python, but for programming in general (what is going on in memory...).
154
-
I've actively used it to debug / trace short pieces of code. Any chance of having it offline (and without the limitations of an online tool like the inability to load all modules)? That would make a perfect pdb visualization tool."
155
-
156
-
You could imagine running a webserver on localhost and using OPT as a graphical frontend for pdb; interesting idea!
157
-
158
-
Notes from an email I sent on 2012-10-24: {
159
-
160
-
One possible offline application is to use OPT as a visual debugger for pdb (http://docs.python.org/library/pdb.html). The use case here would be:
161
-
162
-
1.) The user launches a special version of pdb augmented with OPT.
163
-
2.) The user types in some Python command to visualize.
164
-
3.) pdb starts a local webserver and pops up a web browser window.
165
-
4.) The visualization appears in the web browser window, and the user can interact with it.
166
-
167
-
Actually, now that I think about it, you can start even simpler without pdb. Here is an even simpler starting point:
168
-
169
-
1.) The user writes some code to visualize in a file on his/her computer.
170
-
2.) The user runs a special Python script that runs OPT on that file, launches a local webserver, and pops open a web browser window.
171
-
3.) The visualization appears in the web browser window.
172
-
173
-
Ok, that seems simpler as a starting point, and it will still teach you about local webservers and interfacing between the OPT backend and frontend.
174
-
175
-
Then comes the question of why this offline mode might be useful (beyond being a good learning exercise). After all, just by following the directions in the developer overview docs, you've essentially set up OPT to run offline without an Internet connection. So my plan above doesn't give you any extra functionality. However, I think the potential lies in integrating with a real debugger such as pdb, so that you can run large Python programs, pause execution, and then visualize selected data structures (rather than all data structures in the program, which can get overwhelming).
176
-
177
-
Ok sorry that was mostly me thinking out loud.
178
-
179
-
}
180
-
181
-
Ha, I guess you can call this **"Offline Python Tutor"**!
182
-
183
-
184
-
## Add better Unicode support
185
-
186
-
This project is a great fit for someone familiar with coding in non-English languages.
187
-
188
-
Right now, OPT has poor-to-nonexistent Unicode support, so adding it is important for making it friendlier to
189
-
non-English audiences.
190
-
191
-
Here is one bug report that inspired this project idea:
192
-
193
-
"""
194
-
I’m having some fun with your nifty Python visualiser.
195
-
While trying too see what happens in Unicode strings are processed,
196
-
I encountered some odd little quirks such as a unicode character
197
-
being replace with a string representation of a Unicode code point
198
-
number in denary.
199
-
151
+
## Backend
200
152
201
-
<ahref="http://www.pythontutor.com/visualize.html#code=s+%3D+unicode(0x2015)%0Aa+%3D+'Myer'+%2B+s+%2B+'Briggs'%0Ax+%3D+a.index(s)%0Al+%3D+a%5B%3Ax%5D%0Ar+%3D+a%5Bx+%2B+len(s)%3A%5D%0Aprint+l%0Aprint+r%0Aprint+'%22'+%2B+a+%2B+'%22+is+'+%2B+str(len(a))+%2B+'+characters+long.'%0Afor+i,+z+in+unumerate(a)%3A%0A++print+'a%5B'+%2B+str(i)+%2B+'%5D+%3D+'+%2B+str(z)&mode=display&cumulative=false&py=2&curInstr=8">click to visualize code snippet</a>
202
153
203
-
Changing the first line to
204
-
205
-
```python
206
-
s =u'\u2015'
207
-
```
208
-
209
-
Causes an “unknown error” to be reported, as does the insertion of unicode characters like “—” (em dash) in string literals.
210
-
211
-
The following code causes the interpreter to hang.
212
-
```python
213
-
# -*- coding: utf-8 -*-
214
-
s =u'—'
215
-
```
216
-
"""
217
-
218
-
(Note that Unicode support in Python 2 and 3 involve different subtleties.)
219
-
220
-
221
-
## Visualizing different programming languages (especially JavaScript!)
154
+
### Visualizing different programming languages (especially JavaScript!)
222
155
223
156
This project is great for someone who likes to hack on language implementations and runtimes.
224
157
@@ -254,7 +187,7 @@ trace generator for C and C++.
254
187
It should be much easier to build a backend for a memory- and type-safe language, though :)
255
188
256
189
257
-
## Skulpt (Python-in-JavaScript) backend
190
+
###Skulpt (Python-in-JavaScript) backend
258
191
259
192
This project is appropriate for someone with advanced knowledge of hacking a Python interpreter
260
193
who is willing to make a substantive time commitment.
@@ -286,7 +219,40 @@ Tips & Tricks:
286
219
287
220
Dec 2012: Brython -- http://www.brython.info/index_en.html -- might also be a contender here, since it supports lots of Python 3 (except for OOP, lambdas, exceptions, and generators, afaik).
288
221
289
-
May 2013: The main caveat with re-implementing for one of these alternative Python implementations is that they don't support the full ("official") Python language.
222
+
May 2013: In the experience of Python veterans, the main caveat with targeting one of these alternative Python implementations is that they don't support the full ("official") Python language.
290
223
Thus, users might be frustrated that code they type into this tutor doesn't run exactly like code they type into the official Python interpreter.
291
224
That said, though, a Skulpt implementation would still be useful, as long as users understand its limitations and caveats, and that it doesn't support the full Python language in all of its glory (or its weird edge-case behaviors).
292
225
226
+
227
+
### Offline mode for use as a production debugger
228
+
229
+
From a reader comment: "As a teaching tool it is invaluable, not only for teaching python, but for programming in general (what is going on in memory...).
230
+
I've actively used it to debug / trace short pieces of code. Any chance of having it offline (and without the limitations of an online tool like the inability to load all modules)? That would make a perfect pdb visualization tool."
231
+
232
+
You could imagine running a webserver on localhost and using OPT as a graphical frontend for pdb; interesting idea!
233
+
234
+
Notes from an email I sent on 2012-10-24: {
235
+
236
+
One possible offline application is to use OPT as a visual debugger for pdb (http://docs.python.org/library/pdb.html). The use case here would be:
237
+
238
+
1.) The user launches a special version of pdb augmented with OPT.
239
+
2.) The user types in some Python command to visualize.
240
+
3.) pdb starts a local webserver and pops up a web browser window.
241
+
4.) The visualization appears in the web browser window, and the user can interact with it.
242
+
243
+
Actually, now that I think about it, you can start even simpler without pdb. Here is an even simpler starting point:
244
+
245
+
1.) The user writes some code to visualize in a file on his/her computer.
246
+
2.) The user runs a special Python script that runs OPT on that file, launches a local webserver, and pops open a web browser window.
247
+
3.) The visualization appears in the web browser window.
248
+
249
+
Ok, that seems simpler as a starting point, and it will still teach you about local webservers and interfacing between the OPT backend and frontend.
250
+
251
+
Then comes the question of why this offline mode might be useful (beyond being a good learning exercise). After all, just by following the directions in the developer overview docs, you've essentially set up OPT to run offline without an Internet connection. So my plan above doesn't give you any extra functionality. However, I think the potential lies in integrating with a real debugger such as pdb, so that you can run large Python programs, pause execution, and then visualize selected data structures (rather than all data structures in the program, which can get overwhelming).
252
+
253
+
Ok sorry that was mostly me thinking out loud.
254
+
255
+
}
256
+
257
+
Ha, I guess you can call this **"Offline Python Tutor"**!
0 commit comments