Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 271 Bytes

20240711112258.md

File metadata and controls

14 lines (9 loc) · 271 Bytes

split file name and extension

pathlib has you covered, just make a Path object and access the stem and suffix attributes:

import pathlib

path = pathlib.Path('20240711112258.md')

print(path.stem)  # 20240711112258
print(path.suffix)  # .md

#pathlib