获取输入的五个点画五边形 def pentagonUpdate(): p = {} win = GraphWin("Click", 800, 300)#后面两个值为窗体的长和宽 for i in range(5): p[i] = win.getMouse() p[i].draw(win) polygon = Polygon(p[0], p[1], p[2], p[3], p[4]) polygon.setFill("peachpuff") polygon.setOutline("black") polygon.draw(win) win.get