Draw a triangle...

bonono at gmail.com bonono at gmail.com
Fri Nov 25 03:42:08 EST 2005


Fredrik Lundh wrote:
> The Eternal Squire wrote:
>
> > PyGame is your best bet for pure graphics.  Simple shapes can be done
> > in just a few statements.
>
> the same applies to Tkinter, of course.
>
>     from Tkinter import *
>
>     # set things up
>     c = Canvas(); c.pack()
>
>     # draw stuff
>     c.create_polygon((0, 100, 50, 0, 100, 100), fill="red")
>
>     # get things going
>     mainloop()
>
> at the "draw a triangle" level, the main difference is mostly that
> Tkinter is a bit more likely to be installed on your machine...
Out of curiousity :

why not :
  c = Canvas()
  c.pack()




More information about the Python-list mailing list