... pathlib.

The goal of this series of videos is to demonstrate how to deal with files, paths and folders from python programmatically. We'll mainly discuss the python pathlib module.


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.write_text(create_json(i * j))

Feedback? See an issue? Something unclear? Feel free to mention it here.

If you want to be kept up to date, consider getting the newsletter.