Hey I am trying to automate the process to add watersheds at the most accumulated points at the bottom of the dem layer. I created a stream order to provide as a template to place the points and a flow direction to create the watershed. The stream order has 9111 columns and 6941 rows. I am creating a point shapefile at every value (1,2,3) at the last row of the matrix. The main problem I have is saving multiple points and given them each a unique name and saving watersheds and giving them a unique name each time it goes through a loop. I am pretty novice at python. I need help with the last part of the code. I keep getting a syntax error on the last line.
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">from</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>sa <SPAN class="keyword token">import</SPAN> <SPAN class="operator token">*</SPAN>
<SPAN class="keyword token">from</SPAN> arcpy <SPAN class="keyword token">import</SPAN> env
demorder<SPAN class="operator token">=</SPAN><SPAN class="string token">"C:\Temp\ARCGIS_PROJECT\Tutorial\LAYERS\dem_order"</SPAN>
flowdirection<SPAN class="operator token">=</SPAN><SPAN class="string token">"C:\Temp\ARCGIS_PROJECT\Tutorial\LAYERS\dem_fd"</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> columns <SPAN class="keyword token">in</SPAN> range<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">9111</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
point<SPAN class="operator token">=</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>Point<SPAN class="punctuation token">(</SPAN>demorder<SPAN class="punctuation token">.</SPAN>xmin <SPAN class="operator token">+</SPAN> columns<SPAN class="punctuation token">,</SPAN> dem_order<SPAN class="punctuation token">.</SPAN>ymin<SPAN class="operator token">+</SPAN><SPAN class="number token">6941</SPAN><SPAN class="punctuation token">)</SPAN>
pointval<SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetCellValue_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"dem_order"</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"point"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"2"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>pointval<SPAN class="operator token">==</SPAN><SPAN class="number token">1</SPAN> <SPAN class="operator token">or</SPAN> pointval<SPAN class="operator token">==</SPAN><SPAN class="number token">2</SPAN> <SPAN class="operator token">or</SPAN> pointval<SPAN class="operator token">==</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
pointgeom <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>pointgeometry<SPAN class="punctuation token">(</SPAN>point<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"W:\ArcMap\Coordinate_Systems\NAD 1983 StatePlane Texas S Central FIPS 4204 (US Feet) SURFACE.prj"</SPAN><SPAN class="punctuation token">)</SPAN>
Pshape<SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>CopyFeatures_management<SPAN class="punctuation token">(</SPAN>pointgeom<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"C:\Temp\ARCGIS_PROJECT\Tutorial\points"</SPAN><SPAN class="punctuation token">)</SPAN>
watershed<SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>watershed<SPAN class="punctuation token">(</SPAN>flowdirection<SPAN class="punctuation token">,</SPAN>Pshape<SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CopyRaster_management<SPAN class="punctuation token">(</SPAN>watershed<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"C:\Temp\ARCGIS_PROJECT\Tutorial\points"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>