This commit is contained in:
M. A. Reza 2025-12-01 17:04:57 +03:30
parent 2fab4515bd
commit 0c471c8fb5

View File

@ -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: