pyvista.get_ext

Contents

pyvista.get_ext#

get_ext(filename)[source]#

Extract the extension of the filename.

For files with the .gz suffix, the previous extension is returned as well. This is needed e.g. for the compressed NIFTI format (.nii.gz).

Parameters:
filenamestr, Path

The filename from which to extract the extension.

Returns:
str

The extracted extension. For files with the .gz suffix, the previous extension is returned as well.