Files
PPE2/src/exercises/pathlib_test.py
T

23 lines
510 B
Python

import json
from pathlib import Path
def create_orders():
path = Path("data/processed")
path.mkdir(parents=True, exist_ok=True)
orders_path = path / "orders.csv"
orders_path.open("w", encoding="utf-8")
def create_settings():
settings = {"mode": "debug", "retries": 3}
with Path("data/processed/settings.json").open("w", encoding="utf-8") as f:
json.dump(settings, f, indent=2, ensure_ascii=False)
if __name__ == "__main__":
# create_orders()
(create_settings())