This commit is contained in:
scito 2022-12-24 01:59:35 +01:00
parent 483fcc0163
commit f4934192ae
9 changed files with 303 additions and 389 deletions

View file

@ -17,7 +17,7 @@ import csv
import json
import os
import shutil
from io import StringIO
from io import StringIO, BytesIO
import sys
import glob
@ -102,3 +102,8 @@ def read_file_to_list(filename):
def read_file_to_str(filename):
"""Returns a str."""
return "".join(read_file_to_list(filename))
def read_binary_file_as_stream(filename):
"""Returns binary file content."""
with open(filename, "rb",) as infile:
return BytesIO(infile.read())