Have both the streams and schools layers in my active arcmap session. I am using arcmap's Python window to run this script in a python tutorial that finds schools within a specified distance from streams. Here's the code, error is on line 9:
import arcpy
>>> arcpy.env.workspace = "c:/GIS/Python/data/TravisCounty"
>>> try:
... streams = "Streams.shp"
... streamBuffer = "StreamsBuffer.shp"
... distance = "2640 Feet"
... schools2mile = "Schools.shp"
... arcpy.Buffer_analysis(streams,streamBuffer,distance,'FULL','ROUND','ALL')
... arcpy.MakeFeatureLayer_management(schools2mile,'Schools2Mile_lyr')
... arcpy.SelectLayerByLocation_management('Schools2Mile_lyr','intersect',streamBuffer)
... except:
... print 'Error'
...
Parsing error SyntaxError: invalid syntax (line 9)
import arcpy
>>> arcpy.env.workspace = "c:/GIS/Python/data/TravisCounty"
>>> try:
... streams = "Streams.shp"
... streamBuffer = "StreamsBuffer.shp"
... distance = "2640 Feet"
... schools2mile = "Schools.shp"
... arcpy.Buffer_analysis(streams,streamBuffer,distance,'FULL','ROUND','ALL')
... arcpy.MakeFeatureLayer_management(schools2mile,'Schools2Mile_lyr')
... arcpy.SelectLayerByLocation_management('Schools2Mile_lyr','intersect',streamBuffer)
... except:
... print 'Error'
...
Parsing error SyntaxError: invalid syntax (line 9)