question: parameters for create_polygon() method

SeeBelow at SeeBelow.Nut SeeBelow at SeeBelow.Nut
Wed May 5 00:30:03 EDT 2004


Andrew Bennetts wrote:
> 
> On Wed, May 05, 2004 at 02:11:28AM +0000, SeeBelow at SeeBelow.Nut wrote:
> > Tkinter's canvas object has the method create_polygon().
> >
> > The docs say the parameters should be like:
> > (x1, y1, x2, y2, x3, y3, .....)
> >
> > But it's often much better programming practice to have a list of
> > tuples, each point being a tuple, like this:
> > [(x1, y1), (x2, y2), (x3, y3),......]
> >
> > Is there a good way to manipulate my polygons in the latter form, but
> > still use create_polygon() to draw them?
> 
> create_polygon(*list_of_points)
> 
> -Andrew.

Thanks Andrew, but I don't understand it.  What's that * thing?

Is there a * operator that converts a list of tuples into one big tuple?

Mitchell Timin

-- 
"Many are stubborn in pursuit of the path they have chosen, few in
pursuit of the goal." - Friedrich Nietzsche

http://annevolve.sourceforge.net is what I'm into nowadays.
Humans may write to me at this address: zenguy at shaw dot ca



More information about the Python-list mailing list