Calmcode - pathlib: making folders

Making Folders

1 2 3 4 5 6 7

The code that handles all the creation of files and folders is listed below.

for i in range(10):
  for j in range(5):
      p = Path("data", f"folder-{i}", f"file-{j}.json")
      if not p.parent.exists():
          p.parent.mkdir()
          p.write_text(create_json(i * j))