def draw_screen():
    global text
    for i in range(20):
        print
    print text

def get_event():
    return raw_input()

def process_event(event):
    global text
    if (event == "quit"):
        quit()
    elif (event == "hello"):
        text = "Hello to you too"
    elif (event == "goodbye"):
        text = "Goodbye"
        draw_screen()
        process_event("quit")
    else:
        print "I don't know that event"

# set up a global variable
text = ""

# start the event loop
while True:
    event = get_event()
    process_event(event)
    draw_screen()
