def force_console_input(query: str, allowable, onfail: str='Input not recognised, please try again.\n', case_sensitive=False):
    'Get an input from the user matching some string in allowable.\n\n    Args:\n        query (str): The query to issue the user with.\n        allowable (str or container): The options which the user is allowed to submit.\n            If this is a string, acceptable answers will be substrings.\n            For containers acceptable answers will be elements of the container.\n    \n    Returns:\n        The correct input returned\n    \n    Raises:\n        IOError: A request to quit was submitted.\n    '
    if (not allowable):
        raise ValueError('At least one entry must be allowable.')
    submission = input(query)
    while True:
        if (not case_sensitive):
            submission = submission.lower()
        if (submission in ('quit', 'exit')):
            raise IOError('Exit command received.')
        if (submission in allowable):
            return submission
        submission = input(onfail)
Get an input from the user matching some string in allowable.

Args:
    query (str): The query to issue the user with.
    allowable (str or container): The options which the user is allowed to submit.
        If this is a string, acceptable answers will be substrings.
        For containers acceptable answers will be elements of the container.

Returns:
    The correct input returned

Raises:
    IOError: A request to quit was submitted.
def force_console_input(query: str, allowable, onfail: str='Input not recognised, please try again.\n', case_sensitive=False):
    'Get an input from the user matching some string in allowable.\n\n    Args:\n        query (str): The query to issue the user with.\n        allowable (str or container): The options which the user is allowed to submit.\n            If this is a string, acceptable answers will be substrings.\n            For containers acceptable answers will be elements of the container.\n    \n    Returns:\n        The correct input returned\n    \n    Raises:\n        IOError: A request to quit was submitted.\n    '
    if (not allowable):
        raise ValueError('At least one entry must be allowable.')
    submission = input(query)
    while True:
        if (not case_sensitive):
            submission = submission.lower()
        if (submission in ('quit', 'exit')):
            raise IOError('Exit command received.')
        if (submission in allowable):
            return submission
        submission = input(onfail)