# File: eyes.py # Author: Ernest Ackermann # examines clone method and Text object from graphics import * from time import * def main(): #construct window win = GraphWin('clones',300,200) #construct leftEye leftEye = Circle ( Point(80,50),15) #set colors leftEye.setFill('yellow') leftEye.setOutline('red') #create rightEye by applying clone to leftEye rightEye = leftEye.clone() #move rightEye rightEye.move(50,0) #draw eyes rightEye.draw(win) leftEye.draw(win) #set message and draw it message = Text( Point(100,140),"Hello World!") message.setFill('green') message.draw(win) #set prompt about continuing and number it times = 1 s = str(times) s = s +" click in the window to continue" prompt = Text( Point(150,20), s) prompt.draw(win) p = win.getMouse() prompt.undraw() #change font, color, and type of message message.setFace('arial') message.setFill('blue') message.setStyle('italic') times = times + 1 s = str(times) s = s +" click in the window to continue" prompt = Text( Point(150,20),s) prompt.draw(win) p = win.getMouse() prompt.undraw() #set size of message message.setSize(18) times = times + 1 s = str(times) s = s +" click in the window to continue" prompt = Text( Point(150,20),s) prompt.draw(win) p = win.getMouse() prompt.undraw() message.setSize(24) times = times + 1 s = str(times) s = s +" click in the window to end" prompt = Text( Point(150,20),s) prompt.draw(win) p = win.getMouse() prompt.undraw() leftEye.undraw() sleep(0.8) rightEye.undraw() sleep(0.9) message.setText('Bye Bye') sleep(1) win.close() main()