def str_from_file ( path ) : with open ( path ) as f : s = f . read ( ) . strip ( ) return s
how to return contents of a file in python
Return file contents as string .
def str_from_file(path):
    """
    Return file contents as string.

    """
    with open(path) as f:
        s = f.read().strip()
    return s