# File: exp2.py # # Simple test of graphics module from textbook # See documentation in: # # http://mcsp.wartburg.edu/zelle/python/graphics/graphics/graphics.html # # This time draw some rectangles. from graphics import * import time # make a window for drawing stuff win = GraphWin("Hello", 500, 500) box = Rectangle(Point(240,240), Point(260,260)) box.setFill("orange") box.setWidth(0) box.draw(win) # wait half a second time.sleep(.5) box = Rectangle(Point(260,240), Point(280,260)) box.setFill("orange") box.setWidth(0) box.draw(win) # wait 15 seconds before closing window time.sleep(15) # make the window go away win.close()