You need a "main" loop. What is happening now is that the program runs, completes, and exits in a fraction of a second. Your window will open, then immediately close, like you see.
def main()
while True:
getinput()
draw()
if name == '__name__': main()
