Add a clip_analysis to a buffer_analysis
<p>I'm trying to add a clip_analysis to the buffer_analysis I just completed. </p>

<p>The script that I'm using is:</p>

<pre><code>for i in range(len(cities)):
arcpy.Buffer_analysis(sites[i]+'.shp', sites[i]+'_Buffer3000.shp','3000')
print 'site buffered to',i,'buffer 3000'
arcpy.Clip_analysis(openSpace,[i]+'.shp', [i]+'_OpenSpace.shp')
print 'open space clipped to',i,'city limits'
</code></pre>

<p>When I leave the script like this, I keep getting the following error:</p>

<pre><code>TypeError: can only concatenate list (not "str") to list
</code></pre>

<p>or a error that says unsupported operand type(s) for +: 'int' and 'str'</p>

<p>In the line:</p>

<pre><code>arcpy.Clip_analysis(openSpace,[i]+'.shp', [i]+'_OpenSpace.shp')
</code></pre>

<p>you're trying to append together the list <code>[i]</code> to the string <code>.shp</code></p>

<p>...did you mean to write:</p>

<pre><code>arcpy.Clip_analysis(openSpace,sites[i]+'.shp', [i]+'_OpenSpace.shp')
</code></pre>

python