def integer(message, err='Please enter an integer.'):
    """Command line input and error checking for integers.

    Args:
        message (str): The input message displayed in the command line.
        err (str, optional): The message displayed for an erroneous input.
            Defaults to "Please enter an integer.".

    Returns:
        int: The first sucessfully input integer.
    """
    while True:
        data = input(message)
        data = data.strip()
        if data == '':
            print('Please provide an input.')
            continue
        if '.' in data:
            print(err)
            continue
        try:
            data = int(data)
        except ValueError:
            print(err)
            continue
        return data
