[Tutor] drawing squares

Goofball223@wmconnect.com Goofball223 at wmconnect.com
Thu Sep 29 01:54:03 CEST 2005


Hello

How would I get the following program to draw squares instead of circles?


from graphics import*

def main():
    win=GraphWin()
    shape = Circle(Point(50,50), 20)
    shape.setOutline("red")
    shape.setFill("blue")
    shape.draw(win)
    for i in range(10):
        p = win.getMouse()
        c = shape.getCenter()
        dx = p.getX() - c.getX()
        dy = p.getY -c.getY()
        shape.move(dx,dy)
    win.close()
main() 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050928/88a504b6/attachment.html


More information about the Tutor mailing list