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 …
[View More]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é
[View Less]
Here's a simple Mandelbrot class I plan to use next week. The output
is mindless in this case, but reminiscent of what Mandelbrot first
started seeing at IBM i.e. vague X-ray visions, nothing like the high
resolution colorful MRI photographs we get today. In this case, the
output is just ascii characters.
Future subclasses will take the same information and convert it to
POV-Ray and/or VPython, with a color palette added (color is a
function of the rate of divergence).
Anyway, just studying …
[View More]this source code helps make the concept of
"Mandelbrot Set" become clear, once you've mastered basic Python.
>>> import quickfractal
>>> f = quickfractal.Mandelbrot((-3,-2),(2,2),0.05)
>>> f.checkc()
"""
quickfractal.py
range through complex plane, lower left to upper right,
generating corresponding ascii depending on whether
z = z*z + c converges or diverges.
"""
class Mandelbrot (object):
def __init__(self, lowleft, upright, step,
filename="simpfract.txt",
filepath="c:/python24/Lib/site-packages/"):
self.lowleft = lowleft
self.upright = upright
self.step = float(step)
self.filename = filename
self.filepath = filepath
def checkc(self):
output = file(self.filepath + self.filename, 'w')
re = self.lowleft[0]
while re <= self.upright[0]:
im = self.lowleft[1]
while im <= self.upright[1]:
c = complex(re,im)
z = 0j
for k in range(7):
z = z**2 + c
if abs(z)<10:
output.write('*') # converges
else:
output.write('.') # diverges
im += self.step
re += self.step
output.write('\n')
output.close()
[View Less]
> Interesting indeed. In addition to John's interesting concern, there
> is also the practical issue of how would you prevent someone from
> solving the same problem over and over again, repeating the same work
> for a different dollar?
Well, it's worth something to get each kid literate, so the rewards
begin. I'm not talking money necessarily. We give "credits" even
today, e.g. a pass on to the next reading, more interesting
challenges.
The point is it doesn't matter if the …
[View More]same reading is mastered over
and over, as each time, the reader is different.
> That's not what I meant though. I meant that solving problems is
> intrinsically rewarding. Look at Sudoku, about as visually dull a
> prospect as imaginable, and yet providing a systematic set of
> increasingly difficult problems. Many people spend considerable time
> on it. It's not the decorations and the sound effects, it's the
> problem solving and skill building itself that is what makes a game,
> especially a solitaire game, attractive. People do like to learn.
>
> mt
Yes, I agree these pleasant intellectual rewards exist. However, to
be productive, students need better access to tools of the trade, and
so, as they distinguish themselves, their credit towards various
assets will increase. Study biology real hard, and it's more likely
your village laboratory will get another microscope for you to use.
Kirby
[View Less]
Call for Cooperation
An Atlas of Linguistic Graphs
I'm a researcher in graph theory and networks.
I'm working about a project connected with the theory and the applications of
linguistic graphs, which are mathematical structures useful to represent
languages and consequently to manage the organization of data in different
kinds of scientific fields.
At the present I'm developing an application of these graphs to medicine,
specifically related to the ontology of clinical diseases.
And now to …
[View More]the purpose of this message, which is to ask if someone in this list
can be interested in collaborating with me about the construction of an open
source software useful to represent, to analyse and to compare linguistic
graphs.
I've developed the project but don't have the necessary programming skills to
proceed with the creation of the code.
The software would be distributed in public domain and the collaboration is free
and voluntary.
I really hope that someone can be interested.
In the case, please feel free to contact me by using my private e-mail address.
I'll be pleased to send the complete documentation related to the project.
Really many thanks.
All the best,
Giandomenico Sica
Faculty of Philosophy
Leiden University
giandomenico.sica(a)polimetrica.com
Publications
http://www.polimetrica.com/polimetrica/view/people/Sica,_Giandomenico.html
1st World Congress and School on Universal Logic
http://www.uni-log.org
[View Less]
Darren Payne wrote:
> Re programming - kids want to PLAY GAMES most of all!
> Many would like to program their own games ... but do
> not wish to put in the time/ effort neccessary to
> develop the level of skill required.
It takes between one and three years to develop a commercial game. Students who take on game programming can be soon disappointed because they are likely to produce games that look really primitive in comparison to their favorite commercial games. Many …
[View More]students who thought that they may create real games are eventually destined to be disappointed with the actual products of their game programming experience.
> In addition, programming ... as many of us in this
> list know it ... is primarily CONSOLE BASED - by this
> I mean you spend alot of time entering text on a
> screen to run the thing to get more text on the screen
>- BORING BORING BORING ... FOR MODERN KIDS!
I disagree, particularly when it comes to college/university level students. Text based programming (meaning no GUIs, no graphics) can be very satisfying and rewarding with contemporary college/university students. First, the instructor needs to pick up interesting problems that make sense on their own. Forget about 'write a program to calculate this meaningless expression, because it is a good learning exercise'. Have students do something that they can understand and that makes some sense to them (such as money-related calculations, for example, or a text-based game). It must be something students can manage within a reasonable time interval (such as one class period). The most important features of text-based programs are (1) that students can succeed with them after having applied a reasonable effort and (2) that students can understand then (i.e., be in control while succeeding).
This is what motivates everyone best: (1) succeeding - while doing something that makes some sense - and (2) being in control while succeeding. Text-based programs in Python are good to start this process. Such programs prepare well students for GUIs and graphics. In my Python First courses (http://studypack.com) students start with meaningful and manageable text-based labs and end with some GUIs and graphics. Almost all succeed in their labs and understand what they are doing in the process. One Python First student (in a class taught by a colleague) told me recently that such text-based Python programs actually are helping him understand and manage mathematics better. This statement came to me as a very pleasant surprise.
> Like I said at the start kids want games, fun and
> multimedia - colour, music and animation / video
We should not underestimate our students (particularly at the college/university level) by thinking that only color, music, animation/video, and games can attract them to programming and computer science. This would be wrong. The vast majority of students are willing to learn and understand programming and computing. Really, they are. They are NOT some lazy folks who would not come to class if we do not try to entertain them with multimedia and games. They will come to class if we entertain them with (1) a chance to really *succeed* in meaningful and manageable class activities and (2) a chance to *be in control* and understand while succeeding. GUIs and graphical games are probably not such activities in entry-level studies. Text based programming in Python (which reduces the syntax clutter to a minimum) can serve this purpose really well.
> regards
> Darren Payne
Great post, Daren. Thank you. I understand you share experience with HS students. I wrote of my college/university experience - thing can be somewhat different at HS, I do not know.
Atanas
Atanas Radenski
radenski(a)chapman.edu http://www.chapman.edu/~radenskihttp://studypack.com Digital courses for the net generation
[View Less]