469,286 Members | 2,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

Draw a triangle...

Hi I'm writing a python application on my windows box and I want to draw
a simple triangle on the screen... How can I do this.
Am I going to have to use tcl/tk?
Nov 25 '05 #1
4 27044

JustSomeGuy wrote:
Hi I'm writing a python application on my windows box and I want to draw
a simple triangle on the screen... How can I do this.
Am I going to have to use tcl/tk?


Take a look at Tkinter, Python's wrapper around Tk - you'll find many
things if you Google this!
It's hard to tell yu more not knowing what you really want, since
you're *not telling* ;-)

Nov 25 '05 #2
PyGame is your best bet for pure graphics. Simple shapes can be done
in just a few statements.

The Eternal Squire

Nov 25 '05 #3
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>

Nov 25 '05 #4

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()

Nov 25 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by coinjo | last post: by
16 posts views Thread by VISHNU VARDHAN REDDY UNDYALA | last post: by
geo039
reply views Thread by geo039 | last post: by
19 posts views Thread by lost1 | last post: by
xpun
11 posts views Thread by xpun | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.