What's the right way to load auxiliary non-Python ...
# show-and-tell
j
What's the right way to load auxiliary non-Python files inside of a module? I can use
__file__
and "navigate" from there, but I feel like that's not the right way.
d
https://pypi.org/project/importlib-resources/ is an alternative that I've found useful.
allows usage e.g.
Copy code
with importlib.resources.path('my.package.resource_dir', config_file) as config_path:
🙇‍♂️ 1
j
oh awesome thanks!