https://prefect.io logo
j

Jacob Blanco

04/16/2020, 1:22 PM
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

Dan DiPasquo

04/16/2020, 4:40 PM
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

Jacob Blanco

04/17/2020, 1:30 AM
oh awesome thanks!
3 Views