This commit is contained in:
2024-10-22 00:28:52 +08:00
parent 7243dfc527
commit a80df00960
3 changed files with 27 additions and 30 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
import aiofiles
from pathlib import Path
async def write_file(
file_path: str,
file_path: str | Path,
content: str | bytes,
mode: str = "w",
**kws,
@@ -18,7 +18,7 @@ async def write_file(
await f.write(content)
async def read_file(file_path: str, mode: str = "r", **kws) -> str:
async def read_file(file_path: str | Path, mode: str = "r", **kws) -> str:
"""
读取文件
Args: