# ChapterAnimation/imageAlternate.py """ Alternate two images same size as your canvas every 2 seconds Give the center of the image (Only *.png files); be aware of the image size photo.png has size 160 x 284 pixels draw image in the middle (80,142) """ import time # for sleep from graphics import * def main(): win = GraphWin( "Alternate Images",160,284) im1 = Image(Point(80,142),"ImagesGraphics/photo1.png")#smile im2 = Image(Point(80,142),"ImagesGraphics/photo2.png")#worry while True: im2.undraw() im1.draw(win) time.sleep(2) im1.undraw() im2.draw(win) time.sleep(2) win.close() main()