from processing.tools import *

dictInter = {}

layerList = dictLayersClipCleanDiss.keys()

for item in range(len(layerList)):
    outputFolder = mainLayerFolder + '\\LayersClipCleanDissInter\\'
    #outputLayer = outputFolder + 'Step' + str(item) + '_______' + layerList[item] + '_Inter.shp'
    outputLayer = outputFolder + 'Step' + str(item) + '.shp'
    print(outputLayer)
    
    if item == 0:
        general.runalg("qgis:difference",\
                        areaOfInterest,\
                        dictLayersClipCleanDiss[layerList[item]],\
                        True,\
                        outputLayer)
       
                        
    elif item > 0:
        general.runalg("qgis:difference",\
                        dictInter['Step' + str(item-1)],\
                        dictLayersClipCleanDiss[layerList[item]],\
                        True,\
                        outputLayer)
    
    dictInter['Step' + str(item)]=iface.addVectorLayer(outputLayer , 'Step' + str(item), "ogr")

    
    