Anyone interested in discussing the turtle module?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Anyone interested in discussing the turtle module?

jelkner
Hi All,

I'm working on an introductory CS book using Python with the turtle
module, but I'm finding the inability of turtle.Screen() to take
screen size arguments to be a real pain.  The screen size appears to
depend on the screen size of the host environment, which means
standardizing screen shots for the book becomes impossible.

Any thoughts on this issue?  It would be a huge help in promoting
Python's use in education if we could make use of such a potentially
fine module as the turtle module, but I'm finding it very difficult to
write curriculum materials that use it since students don't have
control over the turtle's screen in any easy to use way.

Thanks!

jeff elkner
open book project
http://openbookproject.net
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

jelkner
I had tried that, but I was concerned that it returned a None, so I
thought there was no way to refer to the screen after using it.
Trying it again, it seems:

import turtle

turtle.setup(800, 600)
wn = turtle.Screen()

alex = turtle.Turtle()
alex.forward(200)

wn.exitonclick()

works just fine.

Thanks, Corey!

jeff elkner
open book project
http://openbookproject.net

On Tue, May 31, 2011 at 5:05 PM, Corey Richardson <[hidden email]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 05/31/2011 04:59 PM, Jeff Elkner wrote:
>> Hi All,
>>
>> I'm working on an introductory CS book using Python with the turtle
>> module, but I'm finding the inability of turtle.Screen() to take
>> screen size arguments to be a real pain.  The screen size appears to
>> depend on the screen size of the host environment, which means
>> standardizing screen shots for the book becomes impossible.
>>
>> Any thoughts on this issue?  It would be a huge help in promoting
>> Python's use in education if we could make use of such a potentially
>> fine module as the turtle module, but I'm finding it very difficult to
>> write curriculum materials that use it since students don't have
>> control over the turtle's screen in any easy to use way.
>>
>> Thanks!
>>
>
> I believe you want turtle.setup,
> http://docs.python.org/library/turtle.html#turtle.setup
>
> - --
> Corey Richardson
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.17 (GNU/Linux)
>
> iQEcBAEBAgAGBQJN5Vf+AAoJEAFAbo/KNFvp6KwH/1MPtZirFpQuUKJvNFIFl7y1
> /8b6txcu23RnGSdwcOwL/lhsLqgA5moNotPEn67ifYSTXKJuxsLvCqbmpin0q4Yi
> ea9Zw3yNwDb5DCm9jofVZHbSE7h/4v2a6aIUzg4RrMzTiie2KmNuoTpKNYYSu+Wo
> 2HxXqJQBFV1d8UJE4tTbQ/1jUOjAi3IZgq7F79Z1lyFwuuvD+0pPwInFnn0iZqo4
> Gl68ndOuB96ZnEtgCtaSdbaP3oPXHWHis/JI2AgtULHkni0ZJXId/DCRtX0S+k7z
> FyMLw7HTPe1GIxOuOW2/ObWMDP1AvMFzbdIES5SVaeHyBFC3/tg4tGEskoP1Ym4=
> =QBCe
> -----END PGP SIGNATURE-----
>
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

Gregor Lingl-2
In reply to this post by jelkner
Hi Jeff,

I think Corey's solution is the canonical one and quite ok.

Just a few remarks concerning the your problem and the turtle module.

1. The present solution for the turtle.Screen() window was introduced by
Vern Ceder for the previous module (as far as I rembmber) and had to be
retained for upward compatibility reasons.

2. I'm also finding the inability of turtle.Screen() to take screen size
arguments
a deficiency. So you could propose your idea to the python issue tracker
(or if  you prefer I could do this also). This will be relevant for
Python 3.3 only
but I'm definitely interested to implement additions and amendments like
this.
(According to the Python 3.3 release schedule, this must be done until
June. 23rd 2012 (!). This should be no problem.)

3. There is (at least) one more way to adjust the initial screensize,
namely by
putting an appropriate entry into a turtle.cfg file. You can customize some
more properties with this file). See

22.1.6.3  How to configure Screen and Turtles in the Python-Docs:

http://docs.python.org/library/turtle.html#how-to-configure-screen-and-turtles

I used this for my book "Python für Kids" where I wanted a consistent
appearance of the turtle window.

4. There are essentially only two classes to be used from the turtle
Module.

So if you want to work object-based, it is possible to do this by

from turtle import Screen, Turtle

I found this to be a bit less verbose and also useful in order to avoid
confusion of
module turtle and class Turtle. (I think to some degree this is a matter
of taste)

5. Probably you will stumble about some other weird features of the
module or
have some bright ideas for amendments or you will have some more questions
converning turtle.py. I'm definitely wanting to discuss these with you
and others.
Perhaps we could arrive at a still better turtle module for Python 3.3.
(But please keep in mind the compatibility requirements for modules in the
standard library).

Best regards

Gregor Lingl

Am 31.05.2011 22:59, schrieb Jeff Elkner:

> Hi All,
>
> I'm working on an introductory CS book using Python with the turtle
> module, but I'm finding the inability of turtle.Screen() to take
> screen size arguments to be a real pain.  The screen size appears to
> depend on the screen size of the host environment, which means
> standardizing screen shots for the book becomes impossible.
>
> Any thoughts on this issue?  It would be a huge help in promoting
> Python's use in education if we could make use of such a potentially
> fine module as the turtle module, but I'm finding it very difficult to
> write curriculum materials that use it since students don't have
> control over the turtle's screen in any easy to use way.
>
> Thanks!
>
> jeff elkner
> open book project
> http://openbookproject.net
> _______________________________________________
> Edu-sig mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/edu-sig
>
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

Mokurai
In reply to this post by jelkner
On Tue, May 31, 2011 at 16:59, Jeff Elkner <[hidden email]> wrote:
> Hi All,
>
> I'm working on an introductory CS book using Python with the turtle
> module,

Under what license?

Can we talk about using Turtle Art in Sugar as a starting point? it
can call Python functions assigned to blocks, providing an easy
transition from pure TA to pure Python. We have support for various
other CS topics on TA blocks, including stack operations. I am
planning to write a Turing machine in TA, using colored dots as cells
on the tape and instructions in the transition table.

> but I'm finding the inability of turtle.Screen() to take
> screen size arguments to be a real pain.  The screen size appears to
> depend on the screen size of the host environment, which means
> standardizing screen shots for the book becomes impossible.
>
> Any thoughts on this issue?  It would be a huge help in promoting
> Python's use in education if we could make use of such a potentially
> fine module as the turtle module, but I'm finding it very difficult to
> write curriculum materials that use it since students don't have
> control over the turtle's screen in any easy to use way.
>
> Thanks!
>
> jeff elkner
> open book project
> http://openbookproject.net
> _______________________________________________
> Edu-sig mailing list
> [hidden email]
> 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://wiki.sugarlabs.org/go/Replacing_Textbooks
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

Vern Ceder-3
In reply to this post by Gregor Lingl-2
On Wed, Jun 1, 2011 at 4:37 PM, Gregor Lingl <[hidden email]> wrote:
Hi Jeff,

I think Corey's solution is the canonical one and quite ok.

Just a few remarks concerning the your problem and the turtle module.

1. The present solution for the turtle.Screen() window was introduced by
Vern Ceder for the previous module (as far as I rembmber) and had to be
retained for upward compatibility reasons.

Indeed, I added that as a hack to give some ability to change screen size on startup. 
 
2. I'm also finding the inability of turtle.Screen() to take screen size arguments
a deficiency. So you could propose your idea to the python issue tracker
(or if  you prefer I could do this also). This will be relevant for Python 3.3 only
but I'm definitely interested to implement additions and amendments like this.
(According to the Python 3.3 release schedule, this must be done until
June. 23rd 2012 (!). This should be no problem.)

I personally don't think that using turtle.Screen() is the way to go with the new version of the turtle library, but it is handy to have it for older examples.
 
3. There is (at least) one more way to adjust the initial screensize, namely by
putting an appropriate entry into a turtle.cfg file. You can customize some
more properties with this file). See

22.1.6.3  How to configure Screen and Turtles in the Python-Docs:

http://docs.python.org/library/turtle.html#how-to-configure-screen-and-turtles

I used this for my book "Python für Kids" where I wanted a consistent appearance of the turtle window.

This is what I used in our "TurtleLab" project that I showed some of you at the 2010 PyCon... for the source of an earlier version, see https://bitbucket.org/vceder/turtlelab/wiki/Home . I'm not actively maintaining it, but my assistant Simon Ruiz has worked on it quite a bit, if there's interest I'll get his latest version merged into the repository.

In general we've found the current turtle  library to be pretty flexible and robust.

Cheers,
Vern
 
4. There are essentially only two classes to be used from the turtle Module.

So if you want to work object-based, it is possible to do this by

from turtle import Screen, Turtle

I found this to be a bit less verbose and also useful in order to avoid confusion of
module turtle and class Turtle. (I think to some degree this is a matter of taste)

5. Probably you will stumble about some other weird features of the module or
have some bright ideas for amendments or you will have some more questions
converning turtle.py. I'm definitely wanting to discuss these with you and others.
Perhaps we could arrive at a still better turtle module for Python 3.3.
(But please keep in mind the compatibility requirements for modules in the
standard library).

Best regards

Gregor Lingl

Am <a href="tel:31.05.2011%2022" value="+13105201122" target="_blank">31.05.2011 22:59, schrieb Jeff Elkner:

Hi All,

I'm working on an introductory CS book using Python with the turtle
module, but I'm finding the inability of turtle.Screen() to take
screen size arguments to be a real pain.  The screen size appears to
depend on the screen size of the host environment, which means
standardizing screen shots for the book becomes impossible.

Any thoughts on this issue?  It would be a huge help in promoting
Python's use in education if we could make use of such a potentially
fine module as the turtle module, but I'm finding it very difficult to
write curriculum materials that use it since students don't have
control over the turtle's screen in any easy to use way.

Thanks!

jeff elkner
open book project
http://openbookproject.net
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig

_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig



--
Vern Ceder
[hidden email], [hidden email]
The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW



_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

jelkner
In reply to this post by Mokurai
Hi Edward,

The book is licensed under the GNU/FDL and is available here:

http://www.openbookproject.net/thinkcs

I'm very familiar with Turtle Art, since a college intern working with
me last Summer did a Sugar to Gnome port of it, which in now in the
debian repositories:

http://packages.debian.org/search?keywords=turtleart

This Summer we will work to get that into Fedora.

While as a classroom teacher I'm a huge fan of turtle art, Python's
own turtle module is the tool of choice for my current intro college
leve textbook project, since it runs on all major platforms and is
part of the Python standard library.

Thanks!

jeff elkner
open book project
http://openbookproject.net

On Wed, Jun 1, 2011 at 6:37 PM, Edward Cherlin <[hidden email]> wrote:

> On Tue, May 31, 2011 at 16:59, Jeff Elkner <[hidden email]> wrote:
>> Hi All,
>>
>> I'm working on an introductory CS book using Python with the turtle
>> module,
>
> Under what license?
>
> Can we talk about using Turtle Art in Sugar as a starting point? it
> can call Python functions assigned to blocks, providing an easy
> transition from pure TA to pure Python. We have support for various
> other CS topics on TA blocks, including stack operations. I am
> planning to write a Turing machine in TA, using colored dots as cells
> on the tape and instructions in the transition table.
>
>> but I'm finding the inability of turtle.Screen() to take
>> screen size arguments to be a real pain.  The screen size appears to
>> depend on the screen size of the host environment, which means
>> standardizing screen shots for the book becomes impossible.
>>
>> Any thoughts on this issue?  It would be a huge help in promoting
>> Python's use in education if we could make use of such a potentially
>> fine module as the turtle module, but I'm finding it very difficult to
>> write curriculum materials that use it since students don't have
>> control over the turtle's screen in any easy to use way.
>>
>> Thanks!
>>
>> jeff elkner
>> open book project
>> http://openbookproject.net
>> _______________________________________________
>> Edu-sig mailing list
>> [hidden email]
>> 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://wiki.sugarlabs.org/go/Replacing_Textbooks
>
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

Mokurai
On Thu, Jun 2, 2011 at 08:05, Jeff Elkner <[hidden email]> wrote:
> Hi Edward,
>
> The book is licensed under the GNU/FDL and is available here:
>
> http://www.openbookproject.net/thinkcs

Excellent. Thank you.

> I'm very familiar with Turtle Art, since a college intern working with
> me last Summer did a Sugar to Gnome port of it, which in now in the
> debian repositories:
>
> http://packages.debian.org/search?keywords=turtleart
>
> This Summer we will work to get that into Fedora.

I should talk to someone about getting it into Ubuntu, to add to Logo,
kturtleart, and the turtle art module in Etoys. ^_^

> While as a classroom teacher I'm a huge fan of turtle art, Python's
> own turtle module is the tool of choice for my current intro college
> leve textbook project, since it runs on all major platforms and is
> part of the Python standard library.

I am planning a multi-year grade school sequence to introduce CS ideas
using TA, with a transition from TA to Python by way of Python blocks
in TA. I will take a look at your work, and see whether it makes sense
to treat it as a followup to mine, or rather to design mine to lead
into yours.

Among the topics I intend to emphasize are Church's Thesis, Gödel
recursive functions, parse trees, stack programming (and hence RPN),
language interpretation, and building a Turing Machine in pure TA.

> Thanks!
>
> jeff elkner
> open book project
> http://openbookproject.net
>
> On Wed, Jun 1, 2011 at 6:37 PM, Edward Cherlin <[hidden email]> wrote:
>> On Tue, May 31, 2011 at 16:59, Jeff Elkner <[hidden email]> wrote:
>>> Hi All,
>>>
>>> I'm working on an introductory CS book using Python with the turtle
>>> module,
>>
>> Under what license?
>>
>> Can we talk about using Turtle Art in Sugar as a starting point? it
>> can call Python functions assigned to blocks, providing an easy
>> transition from pure TA to pure Python. We have support for various
>> other CS topics on TA blocks, including stack operations. I am
>> planning to write a Turing machine in TA, using colored dots as cells
>> on the tape and instructions in the transition table.
>>
>>> but I'm finding the inability of turtle.Screen() to take
>>> screen size arguments to be a real pain.  The screen size appears to
>>> depend on the screen size of the host environment, which means
>>> standardizing screen shots for the book becomes impossible.
>>>
>>> Any thoughts on this issue?  It would be a huge help in promoting
>>> Python's use in education if we could make use of such a potentially
>>> fine module as the turtle module, but I'm finding it very difficult to
>>> write curriculum materials that use it since students don't have
>>> control over the turtle's screen in any easy to use way.
>>>
>>> Thanks!
>>>
>>> jeff elkner
>>> open book project
>>> http://openbookproject.net
>>> _______________________________________________
>>> Edu-sig mailing list
>>> [hidden email]
>>> 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://wiki.sugarlabs.org/go/Replacing_Textbooks
>>
>



--
Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://wiki.sugarlabs.org/go/Replacing_Textbooks
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

jelkner
On Thu, Jun 2, 2011 at 12:24 PM, Edward Cherlin <[hidden email]> wrote:

> On Thu, Jun 2, 2011 at 08:05, Jeff Elkner <[hidden email]> wrote:
>> Hi Edward,
>>
>> The book is licensed under the GNU/FDL and is available here:
>>
>> http://www.openbookproject.net/thinkcs
>
> Excellent. Thank you.
>
>> I'm very familiar with Turtle Art, since a college intern working with
>> me last Summer did a Sugar to Gnome port of it, which in now in the
>> debian repositories:
>>
>> http://packages.debian.org/search?keywords=turtleart
>>
>> This Summer we will work to get that into Fedora.
>
> I should talk to someone about getting it into Ubuntu, to add to Logo,
> kturtleart, and the turtle art module in Etoys. ^_^

It is already in Ubuntu, Edward, by way of Debian...

>> While as a classroom teacher I'm a huge fan of turtle art, Python's
>> own turtle module is the tool of choice for my current intro college
>> leve textbook project, since it runs on all major platforms and is
>> part of the Python standard library.
>
> I am planning a multi-year grade school sequence to introduce CS ideas
> using TA, with a transition from TA to Python by way of Python blocks
> in TA. I will take a look at your work, and see whether it makes sense
> to treat it as a followup to mine, or rather to design mine to lead
> into yours.
>
> Among the topics I intend to emphasize are Church's Thesis, Gödel
> recursive functions, parse trees, stack programming (and hence RPN),
> language interpretation, and building a Turing Machine in pure TA.

Awesome!  I can't wait to see what you come up with.

jeff

>> Thanks!
>>
>> jeff elkner
>> open book project
>> http://openbookproject.net
>>
>> On Wed, Jun 1, 2011 at 6:37 PM, Edward Cherlin <[hidden email]> wrote:
>>> On Tue, May 31, 2011 at 16:59, Jeff Elkner <[hidden email]> wrote:
>>>> Hi All,
>>>>
>>>> I'm working on an introductory CS book using Python with the turtle
>>>> module,
>>>
>>> Under what license?
>>>
>>> Can we talk about using Turtle Art in Sugar as a starting point? it
>>> can call Python functions assigned to blocks, providing an easy
>>> transition from pure TA to pure Python. We have support for various
>>> other CS topics on TA blocks, including stack operations. I am
>>> planning to write a Turing machine in TA, using colored dots as cells
>>> on the tape and instructions in the transition table.
>>>
>>>> but I'm finding the inability of turtle.Screen() to take
>>>> screen size arguments to be a real pain.  The screen size appears to
>>>> depend on the screen size of the host environment, which means
>>>> standardizing screen shots for the book becomes impossible.
>>>>
>>>> Any thoughts on this issue?  It would be a huge help in promoting
>>>> Python's use in education if we could make use of such a potentially
>>>> fine module as the turtle module, but I'm finding it very difficult to
>>>> write curriculum materials that use it since students don't have
>>>> control over the turtle's screen in any easy to use way.
>>>>
>>>> Thanks!
>>>>
>>>> jeff elkner
>>>> open book project
>>>> http://openbookproject.net
>>>> _______________________________________________
>>>> Edu-sig mailing list
>>>> [hidden email]
>>>> 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://wiki.sugarlabs.org/go/Replacing_Textbooks
>>>
>>
>
>
>
> --
> Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
> Silent Thunder is my name, and Children are my nation.
> The Cosmos is my dwelling place, the Truth my destination.
> http://wiki.sugarlabs.org/go/Replacing_Textbooks
>
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

Lee Harr-3
In reply to this post by jelkner

> It would be a huge help in promoting
> Python's use in education if we could make use of such a potentially
> fine module as the turtle module, but I'm finding it very difficult to
> write curriculum materials that use it since students don't have
> control over the turtle's screen in any easy to use way.


I understand the advantage of using something that
is included in the default install, but I found using
the included turtle module to be unsatisfactory.

For me, one of the biggest problems was the whole
multiple windows thing. It's not too bad on linux
where you can set up focus follow mouse and no
raise on click, but explaining that to someone else
and expecting them to set it up is not reasonable.

Anyhow, that's why I started Pynguin:
http://pynguin.googlecode.com/

With this, I find it extremely easy to get the students
started with writing their own code.


Getting back to the turtle module; I did look at
extending the turtle module when I started pynguin.
It explicitly says in the module that it is designed for
extending with another toolkit, but it also imports
Tk at the top level.

I think what I am going to do is implement a subclass
of Pynguin that implements all of the Turtle methods
and then make turtle-compatibility a configuration
option.


One user sent me a py2exe'd version of Pynguin, so
getting it running on windows should not be too
difficult. I was not comfortable posting the exe,
though, since I have no way of knowing what is
in it.

     
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Anyone interested in discussing the turtle module?

roberto-3
In reply to this post by jelkner
On Thu, Jun 2, 2011 at 7:49 PM, Jeff Elkner <[hidden email]> wrote:
> On Thu, Jun 2, 2011 at 12:24 PM, Edward Cherlin <[hidden email]> wrote:
>> On Thu, Jun 2, 2011 at 08:05, Jeff Elkner <[hidden email]> wrote:
>>> Hi Edward,
>>>
>>> The book is licensed under the GNU/FDL and is available here:
>>>
>>> http://www.openbookproject.net/thinkcs
>>
>> Excellent. Thank you.
+1

also, i might finally take the chance of teaching (and learning) CS
for high school students next year, alongside with robotics;
i can't contribute at the moment to your book but i definitely need
educational material for all the range from TA to pure Python, so
please keep us posted !

regards
--
roberto
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig