pytrnsys_process.util.utils.get_file_content_as_string#
- pytrnsys_process.util.utils.get_file_content_as_string(file_path: Path, encoding: str | None = None) str[source]#
Read and return the entire content of a file as a string.
- Parameters:
pathlib.Path (file_path) – Path to the file to read
str (encoding) – File encoding to use. defaults to UTF-8 if that fails it tries to use windows-1252
optional – File encoding to use. defaults to UTF-8 if that fails it tries to use windows-1252
- Returns:
file_content – Content of the file as a string
- Return type: