'''animation1.py -- a first example of animation Jeff Ondich, 10/8/07 Depends on John Zelle's graphics library. ''' import time from graphics import * windowWidth = 600 windowHeight = 400 window = GraphWin('Animation 1', windowWidth, windowHeight) window.setBackground(color_rgb(255, 255, 255)) radius = 40 ball = Circle(Point(radius, windowHeight / 2), radius) ball.draw(window) print 'Type Ctrl-C in the terminal window to make the animation stop.' while True: ball.move(2, 0) time.sleep(0.02)