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