def from_file(filename):
    """Open a file and read its first line.

    :param filename: the name of the file to be read
    :returns: string -- the first line of filename, stripped of the final '\n'
    :raises: IOError
    """

    with open(filename) as f:
        value = f.readline().rstrip('\n')
    return value