Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Basic animation in Python - how to

5 views
Skip to first unread message

http://members.lycos.co.uk/dariusjack/

unread,
Dec 8, 2007, 7:37:30 AM12/8/07
to
I need to draw a shaded rectangle and have flashing (gif animated)
points on it
so not to refresh all objects a rectangle, but points, changing their
colors, attributes.
Please refer me to some basic Python code for animation like that .

Darius

Peter Wang

unread,
Dec 8, 2007, 9:15:46 AM12/8/07
to
On Dec 8, 6:37 am, "http://members.lycos.co.uk/dariusjack/"

What kind of graphical environment and operating system do you want to
do this on? Is there a particular UI toolkit you have in mind? Or do
you want to output an animated gif or small movie file?


-Peter

Donn Ingle

unread,
Dec 8, 2007, 11:54:28 AM12/8/07
to pytho...@python.org
> Please refer me to some basic Python code for animation like that .
You are in for a wild ride! Depending on your platform you can use dozens of
different tools. Try wxPython, pyCairo, pyGTK and PIL (Python Imaging
Library) for the most capable.

Basically you are looking at a fairly complex thing - you need to create
a "context" and then draw into it with commands (they vary according to
your toolkit) and then display the result. Loop that and change the drawing
every time and you have animation.

wxPython has very easy widgets for doing something like this (you can use an
animated gif for example), and it's cross-platform so that a big plus. It's
tricky to get into, but well worth it.

hth
\d

0 new messages