initial
This commit is contained in:
21
ReactDev/utils/file_utils.py
Normal file
21
ReactDev/utils/file_utils.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
|
||||
def read_file(file_path: str) -> str:
|
||||
"""
|
||||
Читает содержимое файла.
|
||||
"""
|
||||
with open(file_path, "r") 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)
|
||||
Reference in New Issue
Block a user