Slithy home


The archive comes with two sets of sample code. One is a small, tidy demonstration of some of the features in the drawing library. You can run this by going into the examples directory and running "python runme.py". The opening screen should look like this:

The source for this example is in examples.py. It's highly recommended that you try running this file as well — this will bring up the diagram and animation objects used to create the presentation in the test window, so you can interactively twiddle them:


The other directory, techfest, contains a Slithy presentation that was used to give a real talk. Unlike the last sample, it is a big, sprawling, untidy mess. There's a fair amount of stuff in it, though, so if you poke around in the code you might find something useful to reuse.

You run the whole presentation with "python techfest.py". The opening screen should look like this:

Some parts of this presentation feature interactivity. These objects have their own controls:

  animated pythagoras:
     the corner where the a and b squares meet is draggable.  the 'a' key 
     resets the diagram and plays it again.

  interactive object explanation:
     once the object is playing, 'a' and 's' generate events.

  bezier (starts as a big empty white rectangle):
     click in the background to add a control point.
     click on a control polygon line to start the construction process.
     'a' advances the construction one step.
     the green control points and the outermost construction dots are
       draggable.
     'g' draws in the curve.
     'c' erases the construction lines and dots.
     'v' erases the curve.
     'd' deletes the last control point.
     'x' resets the diagram: deletes all control points, erases the
       construction lines and the curve.
Many of the other *.py files bring up different bits and pieces of the presentation in the test window if you run them directly. (Also, look at the end of each file for commented out calls to test_object() to see what else can be viewed in the tester — try uncommenting different ones, but don't call test_object() more than once.)