[Edu-sig] Simple frame buffer module

David Pettersson dave@whatever.nu
24 Aug 2001 20:42:19 +0200


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