import os fil=os.path.abspath("report.md") drkt=os.path.dirname(fil) fp1=open(drkt+'/TEMA6/zapis2.bin',mode='wb+')