[Edu-sig] More on graphics with graphics.py (Zelle's)
john.zelle at wartburg.edu
Tue Feb 13 03:33:57 CET 2007
Kirby (and others),
I've had a number of questions lately about the slowness of my graphics
library. I've noticed that some programs run well under Linux (my development
platform) but run very sluggishly under Windows. Was your testing on
Windows? Just curious. If you do get a chance to try your code on both Linux
and Windows, I'd like to know if you notice much difference. When I get some
time (won't hapen until summer) I might have to dig in and try to address
these performance issues on non-Linux platforms. If anyone has any thoughts
on the source of this discrepancy, I'd love to hear them.
On Monday 12 February 2007 2:28 pm, kirby urner wrote:
> Some of you old timers may recall a project in May, 2004 to implement
> Wolfram's minimalist cellular automaton experiments using a Tk canvas
> and/or PIL.
> As I recall, John showed us how to speed it up a whole lot by passing
> some 'False' parameter in the GraphWin call.
> However, now that I'm testing the code, in preparation for this post, lo
> these many years later (on a faster computer in a different version of
> Python (2.5)), and with a newly downloaded graphics.py, I'm seeing
> those rows of the Mayan Pyramid, associated with Wolfram's "Rule 30" ,
> run across the screen like some raster beam on an ultra slow TV.
> In any case, the code isn't all the beautiful, could be streamlined, but
> consists of nks.py atop two possible Canvas objects, one in Tk, one
> in PIL (Python's Imaging Library -- could be a jpeg).
> http://www.4dsolutions.net/ocn/python/nks.py <-- Wolfram's rules 0-255
> http://www.4dsolutions.net/ocn/python/canvas1.py <- PIL canvas
> http://www.4dsolutions.net/ocn/python/canvas2.py <- Tk canvas
> PS: I haven't tested the PIL version for 2.5 yet, seein' as all the recent
> traffic has been about using Tk.
> PPS: this code isn't procedural though, may not be suitable for CS0
> within the United States (a math phobic distopia, except in patches)
>  http://mathworld.wolfram.com/Rule30.html
John M. Zelle, Ph.D. Wartburg College
Professor of Computer Science Waverly, IA
john.zelle at wartburg.edu (319) 352-8360
More information about the Edu-sig