import os fil=os.path.abspath("report.md") drkt=os.path.dirname(fil) print(os.path.exists(drkt + "/TEMA6")) print(os.path.exists(drkt + "/TEMA66"))