research-rainfallradar/aimodel/src/lib/io/readfile.py
2022-12-08 18:31:42 +00:00

9 lines
No EOL
237 B
Python

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