Saturday, March 23, 2013

OLDIE BUT GOODIE: Where have you been all my life, Python?



I suppose that I've been spoiled having entered the world of python via SAGE (computer algebra systems, scientific computing, etc). As you can see in the video above, I've been using SAGE, http://www.sagemath.org and http://www.sagenb.org, in class for some time. I officially introduced SAGE to my high school last year in Computer Math, my introCS class. We use SAGE to run python studying Discrete Mathematics using Gary and Maria Litvin's text http://skylit.com/mathandpython.html which has proven very useAful in class. This year I also started a new course entitled Calculus Research Lab using SAGE as a Computer Algebra System to investigate concepts in Calculus using free online Calculus texts in pdf: http://sage.math.washington.edu/home/wdj/teaching/calc1-sage/ and http://wdjoyner.com/teach/calc2-sage/hoffman-stein-calculus.pdf and http://sage.math.washington.edu/home/wdj/teaching/DiffyQ/des-book.pdf


I only just recently bothered to install IDLE and write source files such as turtleTester.py in Ubuntu. Apparently, the current Ubuntu liveCD ships with python 2.6 and turtle.py is part of it. All I added to the mix was IDLE and I was good to go! Also, I installed the visual module (vpython) and have been playing with that in IDLE as well. In the video above Kirby Urner, a long-time proponent of using python in the mathematics classroom, shows off some of his work especially in geometry, group theory and object orientation. Apparently, there's a lot of math you can do with plain vanilla python!

BTW, you have to take a look at Ron Reiter's awesome website http://www.learnpython.org which has lots of python tutorials including turtle code online! All I had to do to use the turtle and visual modules offline is as follows. Python 2.6 and turtle.py are already installed by default in Ubuntu. So, I ran "sudo apt-get install idle" to make python more user friendly. You don't need IDLE to run python source code, but it makes it very easy for the students. Then I got vpython from the Ubuntu Software Center and vpython needs "sudo apt-get install libgtkglextmm-x11-1.2-dev." VPython works fine in Ubuntu now, but I can't rotate the image with my mouse. I have to look into that a bit.

UPDATE: I'm currently using an online textbook with Turtle Graphics that's great!
UPDATE: http://interactivepython.org


I'm looking forward to doing a final project with my Computer Math class this year involving python's turtle graphics module or VPython 3D modeling or TI83/89 BASIC programming. In this video we have Gregor Lingl, a math teacher from Austria, showing off his turtle.py graphics module which is now standard in python 2.6 and above. His turtle module is an object oriented implementation of the classic logo language in python, http://el.media.mit.edu/logo-foundation/logo/turtle.html and http://www.rupert.id.au/microworlds/index.php and http://www.cs.berkeley.edu/~bh/v1ch10/v1ch10.html. This file
http://www.slideshare.net/calcpage2011/seven-waystouseturtle-pycon2009 is the pdf that goes with Gregor's talk. Here's some documentation http://svn.python.org/projects/python/branches/release25-maint/Lib/lib-tk/turtle.py for the turtle module from the python website. This is the turtle module http://svn.python.org/projects/python/branches/release25-maint/Lib/lib-tk/turtle.py itself. Here's Gregor's textbook http://thepythongamebook.com/en:resources:people:lingl_gregor:start and http://ada.rg16.asn-wien.ac.at/~python/index.html using the turtle module. This is more documentation http://docs.python.org/library/turtle.html and here's Gregor's website http://xturtle.rg16.at Here's the "Think Python" http://greenteapress.com/thinkpython/html/index.html text by Allen B. Downey with a chapter on turtle graphics.


This clip from Showmedo has Erik Thompson, a physics teacher, showing off the visual module or vpython teaching some physics concepts! Here's more videos http://vpython.erikthompson.com from Erik's website. This is the documentation http://vpython.org from the vpython website.

Here's another Showmedo by J. Unpingco about Scientific Computing with python in SAGE.


Well, that's all folks!

Teaching with Technology, 

No comments:

Post a Comment