Draw a triangle...

J

JustSomeGuy

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?
 
J

jmdeschamps

JustSomeGuy said:
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* ;-)
 
T

The Eternal Squire

PyGame is your best bet for pure graphics. Simple shapes can be done
in just a few statements.

The Eternal Squire
 
F

Fredrik Lundh

The said:
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>
 
B

bonono

Fredrik said:
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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,271
Messages
2,571,357
Members
48,042
Latest member
DoraMcBrie

Latest Threads

Top