basename
basename(path)Get the basename of a file
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 basename of the file or a list of basename of the files in case path is a list |
Examples
>>> from rlike import *
>>> x = basename('/home/xyz/mydata.pickle')
>>> x
'mydata.pickle'
>>> x = basename(['/home/xyz/mydata.pickle', '/home/xyz/mydata2.pickle'])
>>> x
['mydata.pickle', 'mydata2.pickle']