file_path_sans_ext

file_path_sans_ext(path)

Get the path of a file without the extension

Parameters

Name Type Description Default
path Union[str, List[str]] Path to the file or a list of paths to files required

Returns

Name Type Description
Union[str, List[str]] the path to the file without the extension or a list of paths of the files without the extension in case path is a list

Examples

>>> from rlike import *
>>> x = file_path_sans_ext('mydata.pickle')
>>> x
'mydata'
>>> x = file_path_sans_ext(['/home/xyz/mydata.pickle', '/home/xyz/mydata.txt'])
>>> x
['/home/xyz/mydata', '/home/xyz/mydata']