From 0c471c8fb5943dc688d1e753dc9e0663b4d5c291 Mon Sep 17 00:00:00 2001 From: "M. A. Reza" Date: Mon, 1 Dec 2025 17:04:57 +0330 Subject: [PATCH] update --- utils/read_wirte_file_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/read_wirte_file_utils.py b/utils/read_wirte_file_utils.py index c36088b..11f481f 100644 --- a/utils/read_wirte_file_utils.py +++ b/utils/read_wirte_file_utils.py @@ -20,6 +20,12 @@ def write_to_file(content, file_path: Path, json_dumps=False, indent=None): return f.write(content) +def append_to_file(content: str, file_path: Path): + file_path.parent.mkdir(parents=True, exist_ok=True) + with open(file_path, mode="a") as f: + return f.write(content) + + def write_binary_to_file(content, file_path: Path): file_path.parent.mkdir(parents=True, exist_ok=True) with open(file_path, mode="wb") as f: