(path, text)
| 38 | |
| 39 | |
| 40 | def write(path, text): |
| 41 | print("saving", path) |
| 42 | |
| 43 | dir = os.path.dirname(path) |
| 44 | if not os.path.exists(dir): |
| 45 | os.makedirs(dir) |
| 46 | |
| 47 | text = text.replace("\r\n", "\n").replace("\r", "\n") |
| 48 | |
| 49 | with open(path, "w") as f: |
| 50 | f.write(text.encode("utf-8")) |
| 51 | |
| 52 | |
| 53 | def delete(path): |