Re: [Edu-sig] teaching python using turtle module

2009-11-29 Thread Edward Cherlin
On Sun, Nov 29, 2009 at 11:34, Brian Blais  wrote:
> Hello,
> I was just playing with the turtle module, and thought it was an interesting
> way to augment the introduction to python (I teach college students, who
> haven't had any programming).  It's a great way to introduce functions,
> for-loops, and general program structures.

If you use the Python-programmable tile in Turtle Art in Sugar, or
Smalltalk in the Turtle Graphics in Etoys, it's even better. I have
been doing presentations on teaching Python in elementary schools, and
working on how to teach basic Computer Science ideas. You can use an
if-then-else to initialize a stream in Python for the first pass, and
get a value at each pass thereafter. The logic can be either in the TA
or the Python.

> After a bit of playing, I realized that I couldn't think of many exaples
> which use turtle with conditional structures (if- and while- statements),

Repeat is used much more often. but of course we can provide examples
of any behavior you like. I like to use the turtle to generate
sequences, where I can use a conditional to stop when the turtle would
go off the screen. Fibonacci numbers, for example, or exponentials.
Similarly for spirals of various types. Simple cases like those are
easy to do in TA, while more complex sequences could use Python. There
are several fractal examples using loops provided with Sugar on a
Stick, including variations on Siepinksi constructions, and the Koch
Snowflake.

When I can get the code for reading the color of a dot on the screen
into the programmable tile, I can program a toy Turing machine, with
an array of dots as the transition table, and a line of dots as the
tape.

> or
> functions that return values, as opposed to "procedures" like:
> def square(length):
>     forward(length)
>     right(90)
>     forward(length)
>     right(90)
>     forward(length)
>     right(90)
>     forward(length)
>     right(90)

Surely you mean

repeat(4)
   forward(length)
   right(90)

> If-statements could possibly be used with some sort of random behavior (if
> rand()<0.5 ...).

Drunkard's Walk.

> Are there any other situations, using turtle, that these
> structures would be natural?

Recent versions of TA contain stack instructions: push, pop, read,
clear. Your students might find it interesting to program Forth
instructions in TA or Python. This has practical applications in
implementing and porting virtual machines such as Parrot and the VMs
in Smalltalk and I-APL.

There is plenty more where this came from. You would also be welcome
to adapt the Python source code for TA tiles to your environment.

> thanks,
> Brian Blais
> --
> Brian Blais
> bbl...@bryant.edu
> http://web.bryant.edu/~bblais
>
>
>
> ___
> Edu-sig mailing list
> edu-...@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>
>



-- 
Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://www.earthtreasury.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Edu-sig] Method / Functions - What are the differences?

2010-03-10 Thread Edward Cherlin
On Wed, Mar 10, 2010 at 09:45, John Posner  wrote:
> [ cross-posting to edu-sig ]
>
> Bruno (and anyone else interested) --
>
> As I promised/threatened, here's the *start* of a write-up on properties,
> aimed at non-advanced Python programmers:
>
>  http://www.jjposner.net/media/python-properties-0310.pdf
>
> I'm interested in corrections, of course. But I'm also interested in
> opinions as to whether this somewhat lengthy treatment is worth the effort
> -- does it improve on existing write-ups?

I find that it will explain things to those who already understand
most of the concepts. However, I felt as though I were being led
through a maze without knowing where we were headed. This suggests
that the concepts can be re-ordered in a manner that will help your
readers more, and then we can refactor further. (Yes, you can apply
Extreme Programming concepts to create Extreme Documentation,
including consultations with users, pair or group writing, frequent
refactoring, and more, as at FLOSSManuals.net.)

Who is your expected audience?

> Tx,
> John
>
> ___
> Edu-sig mailing list
> edu-...@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>



-- 
Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://www.earthtreasury.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Edu-sig] [ANNC] pynguin-0.7 (python turtle graphics application)

2010-04-11 Thread Edward Cherlin
2010/4/11 Lee Harr :
>
> Pynguin is a python-based turtle graphics application.
>     It combines an editor, interactive interpreter, and
>     graphics display area.
>
> It is meant to be an easy environment for introducing
>     some programming concepts to beginning programmers.
>
>
> http://pynguin.googlecode.com/

Lee, are you familiar with the Turtle Art activity in Sugar for the
OLPC XO, also written in Python? It provides blocks for integrating
Python code. You might want to talk to Walter Bender of Sugar Labs
about his plans for expanding TA, some of which match yours.

I have been thinking about how to integrate all of this into a
curriculum where we would apply turtle graphics to many subjects
starting in first grade or perhaps earlier, and later teach
programming and Computer Science within this environment rather than
purely as text.

> This release changes the method of starting and stopping
>     the separate code-running threads. It should be much
>     less susceptible to lock-ups and crashes, though I
>     am still experiencing occasional problems.
>
>
> Pynguin is tested with Python 2.6.4 and uses PyQt (4.6)
>     for its GUI elements. Pynguin is released under GPLv3.
>
>
> Changes in pynguin-0.7:
>     - fixed deadlock when running with many pynguins at instant speed
>     - new threading model greatly reduces problems with lock-ups
>     - added more multi-pynguin examples
>     - added commands turnto('random') and lineto('random')
>     - added more random color possibilities ('rlight', 'rmedium', 'rdark')
>     - allow named colors and html-style colors
>     - added command clear()
>     - added equation plotting examples - cartesian and polar
>     - re-center on (0, 0) when moving view splitter
>     - added svg/pdf worksheets
>
>
> Changes in pynguin-0.6:
>     - fixed crash when using new_pynguin()
>     - fixed possible crash during startup (due to race condition)
>     - added goto('random') and xy() to easily get coordinates
>     - added keyword args for fill -- fill(color=..., rule=...)
>     - added easier access for fillcolor 'random'
>     - added examples using multiple pynguins
>     - remove any added pynguins when using reset()
>     - set window title when using Save As...
>     - better error messages when loading file with errors
>     - whitespace cleanup when saving files
>     - render About image and title at runtime
>     - more examples
>
>
> Changes in pynguin-0.5:
>     - catch errors when processing graphic move queue
>     - capture and hold stdout and stderr
>     - call str() on argument to write
>     - guard against sending non-int to color
>
>
> _
> Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
> https://signup.live.com/signup.aspx?id=60969
> ___
> Edu-sig mailing list
> edu-...@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>



-- 
Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://www.earthtreasury.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Edu-sig] [ANNC] pynguin-0.7 (python turtle graphics application)

2010-04-11 Thread Edward Cherlin
On Sun, Apr 11, 2010 at 21:52, kirby urner  wrote:
> 2010/4/11 Lee Harr :
>>
>> Pynguin is a python-based turtle graphics application.
>>     It combines an editor, interactive interpreter, and
>>     graphics display area.
>>
>
> I like the idea of using turtles to plot graphs.

Illustrated at http://wiki.sugarlabs.org/go/Activities/Turtle_Art#maths
. I have done more examples.

> Replacing graphing
> calculators with Python is easier when there are simple plot functions
> available (yes, I know about matplotlib, Sage...)
>
> Curious how much of the Standard Library turtle model gets used here.
> Is the turtle stuff all rewritten from scratch.
>
> Kirby
> ___
> Edu-sig mailing list
> edu-...@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>



-- 
Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://www.earthtreasury.org/
-- 
http://mail.python.org/mailman/listinfo/python-list