Jul-26-2023, 05:38 AM
(This post was last modified: Jul-26-2023, 05:39 AM by Gribouillis.)
(Jul-25-2023, 10:03 PM)Skaperen Wrote: have a module with some code inside that needs to know what exact file path it was loaded from.Use
__file__or almost equivalently
__spec__.originIn order to reliably aggregate data files to a Python package, it is better to use
importlib.resources
. Also read setuptools' data files support.