def ask(screen, question):
    """ask(screen, question) -> answer"""
pygame.font.init()
current_string = []
display_box(screen, question + ': ' + string.join(current_string, ''))
while 1:
    inkey = get_key()
if inkey == K_BACKSPACE:
    current_string = current_string[0:-1]
elif inkey == K_RETURN:
    break
elif inkey == K_MINUS:
    current_string.append('_')
elif inkey <= 127:
    current_string.append(chr(inkey))
display_box(screen, question + ': ' + string.join(current_string, ''))
return string.join(current_string, '')
How to get an input from user in Pygame and save it as a variable?