def setdirs(outfiles):
    """Create the directories if need be"""
    for k in outfiles:
        fname=outfiles[k]
        dname= os.path.dirname(fname)
        if not os.path.isdir(dname):
            os.mkdir(dname)
def setdirs ( outfiles ) : for k in outfiles : fname = outfiles [ k ] dname = os . path . dirname ( fname ) if not os . path . isdir ( dname ) : os . mkdir ( dname )
Create the directories if need be