Returns the path of all of the data files in a given directory that match a given glob pattern.
Parameters: | datadir : str
package : str, optional
pattern : str, optional
|
---|---|
Returns: | filenames : iterator of str
|
Examples
This will retrieve the contents of the data file for the astropy.wcs tests:
>>> from astropy.utils.data import get_pkg_data_filenames
>>> for fn in get_pkg_data_filenames('maps', 'astropy.wcs.tests',
... '*.hdr'):
... with open(fn) as f:
... fcontents = f.read()
...