def prompt(message, values=None):
    """Prompt a message and return the user input.
    Set values to None for binary input ('y' or 'n'), to 0 for integer input, or to a list of possible inputs.
    """
    if values is None:
        message += ' (y/n)'
    message += ' > '
    while 1:
        ans = input(message)
        if values is None:
            if ans.lower() == 'y':
                return True
            elif ans.lower() == 'n':
                return False
        elif values == 0:
            try:
                read = int(ans)
            except:
                continue
            return read
        elif ans in values:
            return ans