import os fil=os.path.abspath("report.md") drkt=os.path.dirname(fil) print(os.path.split(drkt)) print(type(os.path.split(drkt)))