<?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 List Toolbox then Run in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/list-toolbox-then-run/m-p/149075#M11562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to figure out how to call a tool from another tool in python. In my python script of got something similar to the code below to get a list of all tools and I basically want the script to run them all automatically, but can't figure out how. So basically what is going to happen is someone will create a new tool in the toolbox and this will automatically be added to the process and run automatically without having to alter the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my question is does anyone know how to automatically run a custom python tool? I can get a list of the tools in the toolbox, just not sure how to get them to run automatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy
# Create a list of the conversion tools#
tools = arcpy.ListTools("*_conversion")
# Loop through the list and print each tool's usage#&amp;nbsp;&amp;nbsp; 
e.g., 'Usage: merge &amp;lt;inputs;inputs...&amp;gt; &amp;lt;output&amp;gt; {field_mappings}'#
for tool in tools:&amp;nbsp;&amp;nbsp;&amp;nbsp; 
print arcpy.Usage(tool)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Dec 2012 21:14:00 GMT</pubDate>
    <dc:creator>ShaunWeston</dc:creator>
    <dc:date>2012-12-05T21:14:00Z</dc:date>
    <item>
      <title>List Toolbox then Run</title>
      <link>https://community.esri.com/t5/python-questions/list-toolbox-then-run/m-p/149075#M11562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to figure out how to call a tool from another tool in python. In my python script of got something similar to the code below to get a list of all tools and I basically want the script to run them all automatically, but can't figure out how. So basically what is going to happen is someone will create a new tool in the toolbox and this will automatically be added to the process and run automatically without having to alter the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my question is does anyone know how to automatically run a custom python tool? I can get a list of the tools in the toolbox, just not sure how to get them to run automatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy
# Create a list of the conversion tools#
tools = arcpy.ListTools("*_conversion")
# Loop through the list and print each tool's usage#&amp;nbsp;&amp;nbsp; 
e.g., 'Usage: merge &amp;lt;inputs;inputs...&amp;gt; &amp;lt;output&amp;gt; {field_mappings}'#
for tool in tools:&amp;nbsp;&amp;nbsp;&amp;nbsp; 
print arcpy.Usage(tool)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 21:14:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/list-toolbox-then-run/m-p/149075#M11562</guid>
      <dc:creator>ShaunWeston</dc:creator>
      <dc:date>2012-12-05T21:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: List Toolbox then Run</title>
      <link>https://community.esri.com/t5/python-questions/list-toolbox-then-run/m-p/149076#M11563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you need to pass parameters to your other tools you might want to take a look at this thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://gis.stackexchange.com/questions/11339/arcpy-and-running-python-scripts-with-parameters-within-another-python-script"&gt;http://gis.stackexchange.com/questions/11339/arcpy-and-running-python-scripts-with-parameters-within-another-python-script&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 21:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/list-toolbox-then-run/m-p/149076#M11563</guid>
      <dc:creator>JoelCalhoun</dc:creator>
      <dc:date>2012-12-05T21:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: List Toolbox then Run</title>
      <link>https://community.esri.com/t5/python-questions/list-toolbox-then-run/m-p/149077#M11564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks that is helpful, but that post does get a bit complicated and hard to follow. I've got a solution that is working, but I'd like to be able to do one more thing and that is dynamically name a tool from python code. So I import a toolbox in python then I've got this line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SelectProperty_toolbox(valuationID,"","",buffer,"")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and "SelectProperty" is the name of the script. I want this name to be generated dynamically from the code. So if I could have that bit as a variable like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;{variable}&lt;/SPAN&gt;&lt;SPAN&gt;_toolbox(valuationID,"","",buffer,"")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that would be great, but don't know how to do it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 22:27:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/list-toolbox-then-run/m-p/149077#M11564</guid>
      <dc:creator>ShaunWeston</dc:creator>
      <dc:date>2012-12-05T22:27:37Z</dc:date>
    </item>
  </channel>
</rss>

