def get_input_non_empty(input_str, cast=str):
    """Obtains inputs from STDIN, ensuring that they are not empty"""
    data = ''
    while True:
        try:
            data = input(input_str)
            if data.strip() == '':
                print('Empty input. Try again')
                continue
            return cast(data)
        except Exception:
            continue