<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problems iterating through a list inside a toolbox function using python. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450752#M35326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot, this is going to help me out a lot in this coming week!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Oct 2013 16:37:40 GMT</pubDate>
    <dc:creator>IanSchelly</dc:creator>
    <dc:date>2013-10-21T16:37:40Z</dc:date>
    <item>
      <title>Problems iterating through a list inside a toolbox function using python.</title>
      <link>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450750#M35324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a point file and I need to make a lot of buffers in specific increments but I can't figure out how to interate through a list inside the buffer function. Here is what I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;city_pts = "C:\Urban_Land_Project\Cities\WI_cities.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;buffer_sizes = [1,2,4,7,10,15,20,30]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for x in buffer_sizes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis(city_pts, "C:\Urban_Land_Project\City_buffers\WI_city_buffers*km.shp","2 Kilometers" ,"FULL","ROUND","NONE","&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to have each buffered file to be named "WI_city_buffers*km.shp" with the * being the buffer size. How do I get the arcpy.Buffer_analysis to go through my list?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 16:22:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450750#M35324</guid>
      <dc:creator>IanSchelly</dc:creator>
      <dc:date>2013-10-21T16:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problems iterating through a list inside a toolbox function using python.</title>
      <link>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450751#M35325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have a point file and I need to make a lot of buffers in specific increments but I can't figure out how to interate through a list inside the buffer function. Here is what I have:&lt;BR /&gt;import arcpy&lt;BR /&gt;city_pts = "C:\Urban_Land_Project\Cities\WI_cities.shp"&lt;BR /&gt;buffer_sizes = [1,2,4,7,10,15,20,30]&lt;BR /&gt;for x in buffer_sizes:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis(city_pts, "C:\Urban_Land_Project\City_buffers\WI_city_buffers*km.shp","2 Kilometers" ,"FULL","ROUND","NONE","&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #")&lt;BR /&gt;I need to have each buffered file to be named "WI_city_buffers*km.shp" with the * being the buffer size. How do I get the arcpy.Buffer_analysis to go through my list?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should work: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;r"C:\Urban_Land_Project\City_buffers" + "\\" + "WI_city_buffer" + str(x) + "km.shp"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 16:27:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450751#M35325</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2013-10-21T16:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problems iterating through a list inside a toolbox function using python.</title>
      <link>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450752#M35326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot, this is going to help me out a lot in this coming week!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 16:37:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450752#M35326</guid>
      <dc:creator>IanSchelly</dc:creator>
      <dc:date>2013-10-21T16:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problems iterating through a list inside a toolbox function using python.</title>
      <link>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450753#M35327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
city_pts = "C:\Urban_Land_Project\Cities\WI_cities.shp"
buffer_sizes = [1,2,4,7,10,15,20,30]
for distance in buffer_sizes:
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_shape = "C:\Urban_Land_Project\City_buffers\WI_city_buffers{}km.shp".format(distance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_km = "{} Kilometers".format(distance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis(city_pts, out_shape, out_km, "FULL", "ROUND", "NONE", "#")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:07:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-iterating-through-a-list-inside-a-toolbox/m-p/450753#M35327</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-11T20:07:34Z</dc:date>
    </item>
  </channel>
</rss>

