simple graphics lib

Kevin Altis altis at semi-retired.com
Tue Aug 21 02:30:10 EDT 2001


I wrote a turtle graphics library for PythonCard that might be of interest.
There are many examples of drawing shapes, using multiple turtles at once,
plotting points, etc. Since each turtle is just another Python object, you
should be able to apply them easily to your project. There are some screen
shots at:
http://pythoncard.sourceforge.net/samples2.html
The image at the bottom of the page shows off doing some drawing directly
from the shell.

PythonCard is located at:
http://pythoncard.sourceforge.net/

It requires Python 2.1 and wxPython 2.3.x.

One benefit of using something like the turtle library and PythonCard is
that you can draw interactively from the shell. Note that if you're doing a
simulation with a large number of objects, you will probably need to use
something more "raw" but it depends on your platform, graphics card, number
of simultaneous objects you need to move around in realtime, etc. In that
case, you can combine raw wxPython drawing in your PythonCard program.

Another possibility is using Jython, so that you're coding in Python, but
use the Java libraries for drawing. This is more complicated, but there are
lots of example Java programs to "steal" from. Whether this would be a good
solution, sort of depends on whether you already know the Java libraries.

ka
"Bignose3" <k98jh01 at kzoo.edu> wrote in message
news:b740d7ae.0108201837.59b66065 at posting.google.com...
> I am a student learning python on my own, coming from a C++ backgroud.
>  I am working on a simple project, a simulation of fish, as a way to
> gain experience using python.  I am looking for a simple graphics lib
> that will allow me to display objects- like circles or squares to
> represent the objects I am coding.  Is anyone aware of a lib that will
> allow me to do this.  When learning C++ I used the CMU Graphics Lib
> which worked great.  Let me know if anyone has any ideas.
>
> Thank You
> Joe





More information about the Python-list mailing list