факит

This commit is contained in:
Mikan
2025-06-02 16:43:01 +03:00
parent 4f10dd93c5
commit 6ede1ca15f
13 changed files with 720 additions and 17 deletions

View File

@@ -0,0 +1,21 @@
import os
def read_file(file_path: str) -> str:
"""
Читает содержимое файла.
"""
with open(file_path, "r", encoding="utf-8") as f:
return f.read()
def write_file(file_path: str, content: str):
"""
Записывает содержимое в файл.
"""
with open(file_path, "w", encoding="utf-8") as f:
f.write(content)
def create_directory(path: str):
"""
Создает директорию, если она не существует.
"""
os.makedirs(path, exist_ok=True)