import fileinput


def read_files_into_list(files):
    """
        Reads file into list (should be new line delimited text)
        If no file supplied then reads from stdin
    """
    contents = []
    try:
        contents = [line.strip() for line in fileinput.input(
            files=files if files else ('-',))]
    except IOError as error:
        print('Operation failed: %s' % error)
    return contents