Imagine, if you will, that, through your browswer, you could interact with the Python tutorial, instead of simply reading it, and really try Python. For a concrete example, here's a modified snippet from the tutorial: #==== 3.1.1 Numbers
The interpreter acts as a simple calculator: you can type an expression at it and it will write the value. Expression syntax is straightforward: the operators +, -, * and / work just like in most other languages (for example, Pascal or C); parentheses can be used for grouping. For example: >>> 2+2 4 BOX(>>>) #================ Where BOX(>>>) represents a one-line "box" (html form with text input) in which you could actually type "2+2", and see that you can reproduce the actual example. Ok, that shouldn't be too hard to imagine, as there are already a few apps that can be adapted to do this, the latest being Ian Bicking's HTConsole. Now, imagine if you could also embed some longer examples, no longer at the interpreter prompt, but as some small scripts, and let the user edit them. Then, at the press of a button, you could execute them, and repeat the edit-run cycle as often as you wished, all within your browser. [This is referred to as TEXTBOX() below.] Again, that shouldn't be too hard to do... Then, imagine that you could also have the option to include docTest quiz as described by Jeff Elkner at http://dc.ubuntu-us.org/projects/doctest-quiz.php and mentioned previously on this list. The way you could have this is to have a webpage that looks as follows: #========= Question 1: Write just enough Python code to make the following DocTests pass: """ >>> a = Animal() >>> a.name '' >>> a.friends [] """ TEXTBOX() #============= Running this would invoke invoke properly the docTest module, combining the sample docTest embedded in the page together with the user written code. Imagine if some such tutorials could be designed by anyone, by simply writing standard html documents, with just a few additional arguments, e.g. <p python_type="doctest"> """ >>> a = Animal() >>> a.name '' >>> a.friends [] """ </p> Finally, imagine if you could have, side-by-side, a TEXTBOX and a <canvas> area where you could try turtle graphics. All within your standard webbrowser. The good news is that I have working prototypes for all of the above *except* the last one - but I am pretty sure I know (in principle) how to do that one too. [I'm proud to say that I only use Python - not a single javascript line of code. ;-)] One small caveat: it runs entirely on a single computer - for security reasons. But, if there was a way to have a server-side sandbox, it could be adapted by (I think) changing just one line of code. Now, I'm working (very much part time) on this and would like to release a prototype for public usage within the next few weeks. However, I have no idea what to call it. I've thought of oblique references to Monty Python (e.g. LwB: Learn with Brian - referring to LoB), or made up acronyms (Web Interface to Learn Python, or WILP), but I haven't thought of anything inspiring. So, if you have some suggestions for a name, or if you want to be pre-alpha test user, feel free to contact me directly. Any additional suggestions about additional features for such a program should probably be directed to this list. André _______________________________________________ Edu-sig mailing list [email protected] http://mail.python.org/mailman/listinfo/edu-sig
