def readme ( filename , encoding = 'utf8' ) : with io . open ( filename , encoding = encoding ) as source : return source . read ( )
how to open file only as ascii in python
Read the contents of a file
def readme(filename, encoding='utf8'):
    """
    Read the contents of a file
    """

    with io.open(filename, encoding=encoding) as source:
        return source.read()