def read_string_from_file ( path , encoding = "utf8" ) : with codecs . open ( path , "rb" , encoding = encoding ) as f : value = f . read ( ) return value
python read file with encoding
Read entire contents of file into a string .
def read_string_from_file(path, encoding="utf8"):
  """
  Read entire contents of file into a string.
  """
  with codecs.open(path, "rb", encoding=encoding) as f:
    value = f.read()
  return value