| import os | |
| def write(path, content): | |
| os.makedirs(os.path.dirname(path), exist_ok=True) | |
| with open(path, "w", encoding="utf-8") as f: | |
| f.write(content) | |
| def read(path): | |
| if not os.path.exists(path): | |
| return "" | |
| return open(path, "r", encoding="utf-8").read() |