logo

... pathlib: do not hardcode



Notes

The code used in this video is listed below.

python code

import json

with open("settings/config.json") as f:
    d = json.loads(f.read())

settings/config.json

{
  "setting": "a",
  "config": "b"
}

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



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