[Tutor] [Edu-sig] Simple frame buffer module (fwd)
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Fri, 24 Aug 2001 13:49:58 -0700 (PDT)
Hiya everyone,
Apologies in advance for being forward about forwarding a message. The
following message might be just the thing for people who want to play
around with animation and graphical drawing:
---------- Forwarded message ----------
Date: 24 Aug 2001 20:42:19 +0200
From: David Pettersson <dave@whatever.nu>
To: edu-sig@python.org
Subject: [Edu-sig] Simple frame buffer module
Hi,
I'd like to announce the simple frame buffer module that I wacked
together after being fed up with having to create a GUI every time I
wanted to illustrate something simple in Python (such as the iterative
improvement of some problem). A short sample:
import fb # import module
f = fb.FrameBuffer() # create an instance
f.open(200, 200, "demo") # open a window named "demo"
for i in range(10, 190): # simple loop
f.fg = (i, i, i) # set fg colour
f.plot(i, i) # plot
f.flip() # flip buffers
raw_input('enter to quit') # wait for keypress
f.close() # close window
Could be useful if you want students to be able to create simple
graphics without having to teach them a GUI. The extension uses SDL to
manage the graphics. The extension is available at
http://dave.whatever.nu/python/fb/
Comments, suggestions and bug reports are all very welcome :).
Sincerely,
--
David Pettersson
dave@whatever.nu
_______________________________________________
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig