I am running a Python script in QGIS 2.18.26 and I have a select by location with a code like that:
indir = "C:/Infolder/"
outdir = "C:/Outfolder/"
os.chdir(indir)
for fname in glob.glob("*.shp"):
layerResult = processing.getObject(fname)
QgsMapLayerRegistry.instance().addMapLayer(layerResult)
processing.runalg("qgis:selectbylocation", layerResult, "C:/SomePolygon.shp", u'within',0,0)
result= outdir + 'Test' + fname
processing.runalg('qgis:saveselectedfeatures', layerResult, result)
#processing.load(result)
QgsMapLayerRegistry.instance().removeMapLayers( [layerResult.id()] )
In case there is no section, I receive a pop-up window as follows:
I want to avoid that pop-up window because it slows down the whole process.
Can you please advise how I can get rid of it?