def checkValidFilePath(filepath, makeValid=True):
 folder = os.path.split(os.path.abspath(filepath))[0]
 if (not os.path.isdir(folder)):
  os.makedirs(folder)
 return True

def checkValidFilePath ( filepath , makeValid = True ) : folder = os . path . split ( os . path . abspath ( filepath ) ) [ 0 ] if ( not os . path . isdir ( folder ) ) : os . makedirs ( folder ) return True
checks whether file path location this should also check whether we have write-permissions to the folder but doesnt currently do that! added in: 1 .