question: parameters for create_polygon() method

Andrew Bennetts andrew-pythonlist at puzzling.org
Tue May 4 22:23:27 EDT 2004


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.





More information about the Python-list mailing list