turtle.py and vpython

106 views
Skip to first unread message

A. Jorge Garcia

unread,
Nov 20, 2011, 4:35:36 PM11/20/11
to sage-edu
I'm curious if anyone has had success with turtle graphics in python.
Can this be done in SAGE?

Also, can we use VPython in SAGE?

TIA,
A. Jorge Garcia
Applied Math and CompSci
http://shadowfaxrant.blogspot.com
http://www.youtube.com/calcpage2009

William Stein

unread,
Nov 20, 2011, 8:54:48 PM11/20/11
to sage...@googlegroups.com
On Sun, Nov 20, 2011 at 1:35 PM, A. Jorge Garcia <calc...@aol.com> wrote:
> I'm curious if anyone has had success with turtle graphics in python.
> Can this be done in SAGE?

Hi,

Given that this [1] is called "Turtle Graphics for Tk" (which is
included standard in Python 2.6, 2.7, etc.), it will not work in the
Sage notebook remotely.

That said, for me with Sage-4.7.3 on OS X turtle graphics *just work*
already on the command line. Whether it works or not with a random
Sage install will depend on whether or not one has Tk graphics
support.

Looking over the API from [1], I think it would be really cool to make
a version of this that does work in the notebook. It would be a
great project for somebody to make something with the same API at [1]
that works in the Sage notebook cleanly, using perhaps HTML5 canvas or
something. I would try to do this right now (simply because it would
be really fun), but I don't have infinite time anymore. I don't know
whether I would use (or reuse) any of the code in Python's turtle
module or not.

[1] http://docs.python.org/library/turtle.html

>
> Also, can we use VPython in SAGE?
>
> TIA,
> A. Jorge Garcia
> Applied Math and CompSci
> http://shadowfaxrant.blogspot.com
> http://www.youtube.com/calcpage2009
>

> --
> You received this message because you are subscribed to the Google Groups "sage-edu" group.
> To post to this group, send email to sage...@googlegroups.com.
> To unsubscribe from this group, send email to sage-edu+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sage-edu?hl=en.
>
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

A. Jorge Garcia

unread,
Nov 20, 2011, 9:54:03 PM11/20/11
to sage...@googlegroups.com
OK, what about VPython? Can we do animations such as these

http://showmedo.com/videotutorials/series?name=pythonThompsonVPythonSeries

with jmol or tachyon?

Jurgis Pralgauskis

unread,
Nov 21, 2011, 4:15:29 AM11/21/11
to sage...@googlegroups.com
> Looking over the API from [1], I think it would be really cool to make
> a version of this that does work in the notebook.   It would be a
> great project for somebody to make something with the same API at [1]
> that works in the Sage notebook cleanly, using perhaps HTML5 canvas or
> something.   I would try to do this right now (simply because it would
> be really fun), but I don't have infinite time anymore.   I don't know
> whether I would use (or reuse) any of the code in Python's turtle
> module or not.
> [1] http://docs.python.org/library/turtle.html

Andre Roberge had some experiments
http://code.google.com/p/crunchy/source/browse/trunk/crunchy/src/imports/turtle_js.py
maybe http://raphaeljs.com/ could help also

http://www.learnpython.org/ has some live online turte!
just havent examined the code...

the idea could complement http://people.csail.mit.edu/pgbovine/python/
very well for programming education :)

--
Jurgis Pralgauskis
tel: 8-616 77613;
Don't worry, be happy and make things better ;)
http://kompiuterija.pasimokom.lt

A. Jorge Garcia

unread,
Nov 22, 2011, 4:50:51 PM11/22/11
to sage...@googlegroups.com
I was just curious. My students and I have Python 2.6 on our Ubuntu boxes. We added IDLE, and vpython. The turtle module was already installed . We are spoiled with SAGE. We only now started playing with IDLE and our own python source files such as turtleTester.py

Thanx,
Sent via DROID on Verizon Wireless

A. Jorge Garcia

unread,
Nov 22, 2011, 7:23:56 PM11/22/11
to sage...@googlegroups.com
William Stein &lt;wst...@gmail.com&gt; wrote:On Sun, Nov 20, 2011 at
1:35 PM, A. Jorge Garcia &lt;calc...@aol.com&gt; wrote:
&gt; I'm curious if anyone has had success with turtle graphics in
python.
&gt; Can this be done in SAGE?

Hi,

Given that this [1] is called "Turtle Graphics for Tk" (which is
included standard in Python 2.6, 2.7, etc.), it will not work in the
Sage notebook remotely.

That said, for me with Sage-4.7.3 on OS X turtle graphics *just work*
already on the command line. Whether it works or not with a random
Sage install will depend on whether or not one has Tk graphics
support.

Looking over the API from [1], I think it would be really cool to make
a version of this that does work in the notebook. It would be a
great project for somebody to make something with the same API at [1]

that works in the Sage notebook cleanly, using perhaps HTML5 canvas or


something. I would try to do this right now (simply because it would
be really fun), but I don't have infinite time anymore. I don't know
whether I would use (or reuse) any of the code in Python's turtle
module or not.

[1] http://docs.python.org/library/turtle.html

I was just curious. My students and I have Python 2.6 on our Ubuntu

boxes. We added IDLE, and vpython. The turtle module was already

installed. We are spoiled with SAGE. We only now started playing with
IDLE and our own source files!

Regards,

Reply all
Reply to author
Forward
0 new messages