def read_to_list(file):
    'Read the content of a file to list\n\n    Verify the existence of a file, then read it to a list by\n    stripping newlines. The function aborts the program if the file does not exist.\n\n    :param str file: Path to an existing file\n    :return: list of strings\n    :rtype: list[str]\n    '
    if (not os.path.isfile(file)):
        errwarn(('*** error: file "%s" does not exist!' % file))
        _abort()
    with open(file, 'r') as f:
        out = f.read().splitlines()
    return out
Read the content of a file to list

Verify the existence of a file, then read it to a list by
stripping newlines. The function aborts the program if the file does not exist.

:param str file: Path to an existing file
:return: list of strings
:rtype: list[str]
def read_to_list(file):
    'Read the content of a file to list\n\n    Verify the existence of a file, then read it to a list by\n    stripping newlines. The function aborts the program if the file does not exist.\n\n    :param str file: Path to an existing file\n    :return: list of strings\n    :rtype: list[str]\n    '
    if (not os.path.isfile(file)):
        errwarn(('*** error: file "%s" does not exist!' % file))
        _abort()
    with open(file, 'r') as f:
        out = f.read().splitlines()
    return out