def file2list(f, strip=True):
    """A list from strings from a file.

    Parameters
    ----------
    f : string
      The name of the file to read.
    strip : bool, optional
      Set to `True` to strip whitespace from each line.

    Returns
    -------
    lines : list
      The contents of the file.

    """

    lines = []
    with open(f, 'r') as inf:
        for line in inf.readlines():
            lines.append(line.strip() if strip else line)
    return lines