[Tutor] How do I make Python draw?

Nathan Pinno falcon3166 at hotmail.com
Thu Jul 28 01:05:10 CEST 2005


Pygame looks solid. I'm sold on it. Maybe I'll be able to code my Guess the 
Number Sequence Game with it using Python.
----- Original Message ----- 
From: "Danny Yoo" <dyoo at hkn.eecs.berkeley.edu>
To: "Nathan Pinno" <falcon3166 at hotmail.com>
Cc: <tutor at python.org>
Sent: Wednesday, July 27, 2005 3:04 PM
Subject: Re: [Tutor] How do I make Python draw?


>
>
> On Wed, 27 Jul 2005, Nathan Pinno wrote:
>
>> How do I make Python draw a shape? e.g. a triangle Is there a specific
>> module that I have to call, or what is the command(s)?
>
> Hi Nathan,
>
> If you'd like to start doing graphical stuff, you might want to look at
> the Tkinter module.
>
>    http://www.python.org/doc/lib/module-Tkinter.html
>
> There's an introduction to it here:
>
>    http://www.pythonware.com/library/tkinter/introduction/
>
>
> Just to whet your appetite, here's a quick-and-dirty demo program that
> should draw a triangle for you:
>
> ######
> """Draws a triangle on a Tkinter canvas."""
>
> from Tkinter import *
> canvas = Canvas()
> canvas.create_polygon([(1, 1), (1, 200), (100, 100)])
> canvas.pack()
> canvas.update_idletasks()
> ######
>
>
> If you want to do more sophisticated graphics stuff, there are alternative
> packages, like pygame:
>
>    http://www.pygame.org/news.html
>
>
> If you have more questions, please feel free to ask!
>
> 


More information about the Tutor mailing list