Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 25th, 2005, 12:15 AM
JustSomeGuy
Guest
 
Posts: n/a
Default 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?


  #2  
Old November 25th, 2005, 01:55 AM
jmdeschamps@gmail.com
Guest
 
Posts: n/a
Default Re: Draw a triangle...


JustSomeGuy wrote:[color=blue]
> 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?[/color]

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* ;-)

  #3  
Old November 25th, 2005, 04:25 AM
The Eternal Squire
Guest
 
Posts: n/a
Default Re: Draw a triangle...

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

The Eternal Squire

  #4  
Old November 25th, 2005, 08:35 AM
Fredrik Lundh
Guest
 
Posts: n/a
Default Re: Draw a triangle...

The Eternal Squire wrote:
[color=blue]
> PyGame is your best bet for pure graphics. Simple shapes can be done
> in just a few statements.[/color]

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>



  #5  
Old November 25th, 2005, 08:55 AM
bonono@gmail.com
Guest
 
Posts: n/a
Default Re: Draw a triangle...


Fredrik Lundh wrote:[color=blue]
> The Eternal Squire wrote:
>[color=green]
> > PyGame is your best bet for pure graphics. Simple shapes can be done
> > in just a few statements.[/color]
>
> 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...[/color]
Out of curiousity :

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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles