<?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 How to call a python toolbox script tool outside Pro in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-to-call-a-python-toolbox-script-tool-outside/m-p/751669#M24619</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Someone gave me a python toolbox with a GP script tool in it.&amp;nbsp; It works fine in Pro, but I'd like to run it from a command window, outside of Pro.&amp;nbsp; Should this be possible?&amp;nbsp; I can't figure out how to set the parameters that the tool needs.&amp;nbsp; I can easily call other GP tools, like GetCount, etc.&amp;nbsp; I'm running Pro 2.4.3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Feb 2020 00:29:10 GMT</pubDate>
    <dc:creator>TheodoreRakel</dc:creator>
    <dc:date>2020-02-07T00:29:10Z</dc:date>
    <item>
      <title>How to call a python toolbox script tool outside Pro</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-call-a-python-toolbox-script-tool-outside/m-p/751669#M24619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Someone gave me a python toolbox with a GP script tool in it.&amp;nbsp; It works fine in Pro, but I'd like to run it from a command window, outside of Pro.&amp;nbsp; Should this be possible?&amp;nbsp; I can't figure out how to set the parameters that the tool needs.&amp;nbsp; I can easily call other GP tools, like GetCount, etc.&amp;nbsp; I'm running Pro 2.4.3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2020 00:29:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-call-a-python-toolbox-script-tool-outside/m-p/751669#M24619</guid>
      <dc:creator>TheodoreRakel</dc:creator>
      <dc:date>2020-02-07T00:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a python toolbox script tool outside Pro</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-call-a-python-toolbox-script-tool-outside/m-p/751670#M24620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The parameters come from entry into the toolbox.&lt;/P&gt;&lt;P&gt;If you open the script that is associated with the toolbox, you could hardcode the parameters into the script ensuring that you match the parameter number with the appropriate parameter. (probably a GetParameterAsText, or GetParameter or even a sys.argv).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can even provide them at the end of a script and check to see if __main__ is running, and if so, provide the parameters there&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; __name__ &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"__main__"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="string token"&gt;"""optional location for parameters"""&lt;/SPAN&gt;
    script &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;argv&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\nRunning... {}\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;script&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arg_1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"something"&lt;/SPAN&gt;
    arg_2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"something else"&lt;/SPAN&gt;
    arg_3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:54:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-call-a-python-toolbox-script-tool-outside/m-p/751670#M24620</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T07:54:57Z</dc:date>
    </item>
  </channel>
</rss>

