research-rainfallradar/aimodel/src/lib/io/readfile.py

9 lines
237 B
Python
Raw Normal View History

import io
from .handle_open import handle_open
def readfile(filepath, transparent_gzip=True):
handle = io.open(filepath, "r") if transparent_gzip else handle_open(filepath, "r")
content = handle.read()
handle.close()
return content