Get Filename without extension using Python

I am working with processing files, which are stored in an hierarchical manner, during the processing of them i want specific filename, only the filename, without the path or the extension. How can this be done using path ?

For Example:

Consider the path and filename as

path/rootdir/branch1/branch1_1/file.txt

from this i want to get only "file" as output, in one single simple step.