""" ChapterAnimation/keyLetter.py Display the letter you type on the middle of the canvas. Only if you type another letter it updates. """ from graphics import * winW,winH = 300,300 # window Width x Height def main(): win = GraphWin( "Type a letter", winW, winH ) Text(Point(100,10),"Type any letter!").draw(win) myt = Text(Point(100,10)," ") # my letter myt.draw(win) while True: k = win.getKey() if k: myt.undraw() myt = Text(Point(winW/2,winH/2),k) myt.draw(win) main()