parsonz

Using subprocess to call another script but get an error

Discussion created by parsonz on Sep 27, 2011
Latest reply on Sep 28, 2011 by stacyrendall
OK - I'm basically trying to batch process a number of shapefiles in one directory, first clipping them, then multiple bufferring.
I thought I would use the subprocess module to call a second script to do the buffering; however, i get the following error;

WindowsError: [Error 193] %1 is not a valid Win32 application

I've posted my code below;
#This is the initial script that calls the second
import arcpy
from arcpy import env
import subprocess

# Local variables:
env.workspace = "C:\\Users\\Claire Parsons\\Documents\\Projects\\site_Selection_Testing\\Clip"
fcs = arcpy.ListFeatureClasses()
clipout = "_clip.shp"
clipFeature = "C:\\Users\\Claire Parsons\\Documents\\Projects\\site_Selection_Testing\\Clip\\East_Mids.shp"

for fc in fcs:
    dsc = arcpy.Describe(fc)
   
    arcpy.Clip_analysis(dsc.catalogpath, clipFeature, dsc.catalogpath.rstrip(".shp") + clipout,"")

           
    subprocess.Popen([r"C:\Users\Claire Parsons\Documents\Projects\Python\Multiple_buffer.py"])

Outcomes