I am working on a script which takes shapefiles from one folder called "Original files", process them and then output the results into another folder named "Processed files. I asked a question on how this can be done on stackoverflow (which includes a diagram) and received a detailed answer. I'm now trying to incorporate that answer into the script but unfortunately no shapefiles are being saved into the Processed files folders.
from os.path import expanduser home = expanduser("~") root_dir = home + "\Test\\" original_dir = 'Original files' processed_dir = 'Processed files' outputs_1=general.runalg("qgis:creategrid", 1000, 1000, 24108, 18351.157175, 258293.802316, 665638.226408, 1, 'EPSG:7405', None) for path, subdirs, files in os.walk(root_dir): if original_dir in path: for file in files: if file.endswith('.shp'): outputs_2=general.runalg("qgis:clip", outputs_1['SAVENAME'], file, os.path.sep.join(path.split(os.path.sep)[:-1]) + os.path.sep + processed_dir + os.path.sep + file)
Am I missing an obvious step?