# File: exp3.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 boxes marching across the screen from graphics import * import time # make a window for drawing stuff win = GraphWin("Hello", 500, 500) # initial coordinates x = 0 y = 240 for i in range(10): box = Rectangle(Point(x,y), Point(x+20,y+20)) box.setFill("orange") box.setWidth(0) box.draw(win) x = x + 20 # wait half a second time.sleep(.5) # end of for i # wait before closing window time.sleep(60) # make the window go away win.close()