2d graphics - what module to use?
gatti at dsdata.it
Fri Jul 25 10:20:47 CEST 2008
On 25 Lug, 08:13, Pierre Dagenais <pierre.dagen... at ncf.ca> wrote:
> What is the easiest way to draw to a window? I'd like to draw something
> like sine waves from a mathematical equation.
> Newbie to python.
What you are really asking for is what GUI library you should use;
every one allows you to draw freely. What do you need to do besides
drawing sine waves? You should look at your full range of options;
http://wiki.python.org/moin/GuiProgramming is a good starting point.
The "easiest" way to draw might be with those toolkits that offer
primarily a canvas to draw on rather than composable widgets. For
example, Pyglet (http://pyglet.org/) offers OpenGL contexts with
sensible defaults and unobtrusive automation:
from pyglet import *
from pyglet.gl import *
win = window.Window(width=700, height=700, caption="sine wave demo",
glColor3f(0.9, 1.0, 0.8)
for x in xrange(0,win.width):
More information about the Python-list