read/lines

This commit is contained in:
Marc Beninca 2024-09-13 18:58:57 +02:00
parent b3e66ec1c3
commit 78dd431ca5
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -58,8 +58,9 @@ def read_file_bytes(file_path: str) -> bytes:
return file_object.read() return file_object.read()
def read_file_lines(file_path: str, charset: str = CHARSET): def read_file_lines(file_path: str, charset: str = CHARSET) -> list[str]:
return read_file_text(file_path).split(os.linesep) """Read whole file lines."""
return read_file_text(file_path, charset).split(os.linesep)
def read_file_text(file_path: str, charset: str = CHARSET) -> str: def read_file_text(file_path: str, charset: str = CHARSET) -> str: