basename_wo_ext()

audeer.basename_wo_ext(path, *, ext=None)[source]

File basename without file extension.

Parameters
  • path (str | bytes) – file or directory name

  • ext (Optional[str]) – explicit extension to be removed

Return type

str

Returns

basename of directory or file without extension

Examples

>>> path = "/test/file.wav"
>>> audeer.basename_wo_ext(path)
'file'