Closed sunt05 closed 1 year ago
Describe the issue
os.path.dirname(__file__) is not a good way to load data files. It is not portable and it is not a good way to load data files from a package.
os.path.dirname(__file__)
Describe the solution you'd like
from importlib.resources import files is a new feature in Python 3.9. It allows us to load data files from a package.
from importlib.resources import files
References
Describe the issue
os.path.dirname(__file__)
is not a good way to load data files. It is not portable and it is not a good way to load data files from a package.Describe the solution you'd like
from importlib.resources import files
is a new feature in Python 3.9. It allows us to load data files from a package.References