from graphics import * def main(): win = GraphWin("Mouse Clicks",800,600) T = Text(Point(400,300),"Click a mouse anywhere in this window") T.setSize(22) T.draw(win) T2 = Text(Point(400,500),"") T2.setSize(22) T2.draw(win) for i in range(10): x = win.getMouse() # the point where the mouse click occured x_coord = str(int(x.getX())) y_coord = str(int(x.getY())) T2.setText("(" + x_coord + "," + y_coord + ")") win.close() main()