Getting the filename using Python's pathlib November 13, 2019 Path(path/to/filename.file_extension).stem gives filename.