Visual Python

As a mathematician, computer scientist, engineer, and wannabe teacher, I found a lot to be pleasantly surprised about in Visual Python, or VPython.  This is a Python module that provides an easy to use API for creating and animating 3D graphics.  I had looked at VPython a couple of years ago, but then tossed it into one of the dustier bins in the back of my mind, mostly because of awkwardness of installation.  But just last week a student suggested that I take a second look… and it is definitely worth a second look.

There are a lot of different environments, languages, libraries, etc., for creating graphics.  So what makes VPython special?  It does a lot of important things right.  First, it is now very easy to install, as easy as Python itself, on at least the Windows and Mac OS X platforms that I have tested (although it also advertises Linux which I have no reason to doubt).  Jumping easily between Windows and Mac is a pretty important requirement for students, with Macs at school and often Windows at home.

Second– and this is the cool part that makes VPython stand out in my opinion– it eliminates the need for the programmer to handle the details of window system management and multi-threading that is always a part of any graphical application.  You do not have to think about decoupling rendering and event handling, things that are a part of the graphics solution space.  Instead, you spend your time thinking about the problem space of the 3D objects and how they move and interact.  When you create a sphere, or plot of a function, or whatever, the window in which to display the graphics is created for you.  When you change the object’s position or add points to the function plot, a separate rendering thread handles the update to the window display for you.

For non-programmers, this may not sound like such a big deal.  But this is an attribute lacking in even the simplest of graphics APIs, including Python’s built-in turtle module.  (Ok, I have used the Allegro game programming library, which uses this approach, but it is not what I would call an easy one-click install, particularly for multiple platforms.)

It is this simplicity of the “Hello World” ease with which you can create non-trivial graphical displays, move objects around, etc., that makes VPython a potentially great resource for educators, including parents working with their children at home.

I say “potentially,” because I have not yet begun working with VPython with my small group of students.  But I plan on it, am excited about it, and hopefully the students will be excited as well.

This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to Visual Python

  1. Pingback: Fun with Dimensional Analysis | Possibly Wrong

  2. Pingback: Flocking Boids and Emergent Behavior | Possibly Wrong

  3. Pingback: Yet Another Rubik’s Cube | Possibly Wrong

  4. Pingback: Kinect skeleton tracking with Visual Python | Possibly Wrong

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s