Draw a triangle...

Fredrik Lundh fredrik at pythonware.com
Fri Nov 25 09:16:04 CET 2005


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...

</F>






More information about the Python-list mailing list