Notes of Get your resources faster, with importlib.resources by Barry Warsaw

Talk notes thepkg/ # is a package since has __init__.py __init__.py a.py b.py data/ sample.dat You need to get data files (templates, certifs etc) from your package You do import thepkg from pathlib import Path pkg = Path.(thepkg.__file__).parent path = pkg / ‘data’ / ‘sample.dat’ Problem as __file__ not necessarily a real file on system …

Notes of Get your resources faster, with importlib.resources by Barry Warsaw Read More »