<?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: Is there an option to disable &amp;quot;Run python script in process&amp;quot; for a Python toolbox? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597250#M46765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you enabled background processing in Geoprocessing Options to make it run in the background? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested a tool in python toolbox with a popup message. It works nicely only when self.canRunInBackground = True and background processing is enabled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2015 22:21:14 GMT</pubDate>
    <dc:creator>MahtabAlam1</dc:creator>
    <dc:date>2015-01-22T22:21:14Z</dc:date>
    <item>
      <title>Is there an option to disable "Run python script in process" for a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597245#M46760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When doing Add &amp;gt; Script from a custom Toolbox, one of the checkbox options on the second page is "Run Python script in process".&amp;nbsp; I have some Python code which ultimately pops up a modal window (the user chooses a cert for an HTTP connection) -- that popup window seems to fight with the "Executing Tool..." window in ArcMap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have proven that the same Python code added as a script to a custom toolbox &lt;STRONG&gt;&lt;EM&gt;with 'Run Python script in process' unchecked&lt;/EM&gt;&lt;/STRONG&gt; works fine.&amp;nbsp; (the popup window can be clicked on)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't seem to find any option for "Run python script in process" or not for Python toolboxes?!&amp;nbsp; Is it so integrated that it cannot be run in a separate process?&amp;nbsp; Is there possibly anything I could add to the __init__ to toggle this?&amp;nbsp; (seems doubtful)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insight to this would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 16:35:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597245#M46760</guid>
      <dc:creator>AaronSimmons</dc:creator>
      <dc:date>2014-08-21T16:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to disable "Run python script in process" for a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597246#M46761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the canRunInBackground property. &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Defining_a_tool_in_a_Python_toolbox/001500000024000000/"&gt;See these docs&lt;/A&gt;. I believe this is new at 10.2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 16:54:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597246#M46761</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2014-08-21T16:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to disable "Run python script in process" for a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597247#M46762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The canRunInBackground property did not help.&amp;nbsp; I added:&lt;/P&gt;&lt;PRE&gt;self.canRunInBackground = True&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I still could not click the popup window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This got me poking around some more, and what I found peculiar is when I right-click the script and choose Properties (this is under ArcToolbox..on the .pyt file I added) --- the "Always run in foreground" is checked and greyed out where I cannot change it?!&amp;nbsp; [interestingly, right-clicking a script under a custom toolbox (under Catalog &amp;gt; Toolboxes)--I can uncheck the "Always run in foreground" checkbox]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are Python Toolboxes (.pyt files)--are they forced to always run in foreground?!?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 17:14:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597247#M46762</guid>
      <dc:creator>AaronSimmons</dc:creator>
      <dc:date>2014-08-21T17:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to disable "Run python script in process" for a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597248#M46763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are there any Python toolbox (.pyt file) experts out there that know if .pyt files can be run &lt;EM&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/EM&gt; "in the Python process"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 15:01:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597248#M46763</guid>
      <dc:creator>AaronSimmons</dc:creator>
      <dc:date>2014-08-22T15:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to disable "Run python script in process" for a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597249#M46764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might be mistaken but an option for you is to put the logic of your tool in another script and then use os.startfile(YourPythonFile) to at least run the logic out of process.&amp;nbsp; You might want to check to see if there is a way to pass arguments to that file as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 21:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597249#M46764</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2015-01-22T21:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to disable "Run python script in process" for a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597250#M46765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you enabled background processing in Geoprocessing Options to make it run in the background? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested a tool in python toolbox with a popup message. It works nicely only when self.canRunInBackground = True and background processing is enabled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 22:21:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597250#M46765</guid>
      <dc:creator>MahtabAlam1</dc:creator>
      <dc:date>2015-01-22T22:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to disable "Run python script in process" for a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597251#M46766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On the "Source" tag of the script properties, you should see the "Run Python script in process" window.&amp;nbsp; Above that, is a browse box for the "Script File".&amp;nbsp; If this is blank, the Run in process is greyed out. If you browse to a python script in the "Script File:" box, and OK, then get properties again, the box will no longer be greyed out so you can uncheck it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will be greyed out if you just imported the script to the tool.&amp;nbsp; You can even set a script file, uncheck it, remove the script file, then re-import the script if you need it this way (to pin to a toolbar button for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;R_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 19:50:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597251#M46766</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2015-01-26T19:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to disable "Run python script in process" for a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597252#M46767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron, I just encountered this issue myself and located this post. What I discovered was very similar to you, as soon as I set canRunInBackground to true in an &lt;EM&gt;existing&lt;/EM&gt; .pyt I noticed the 'Always Run in foreground' in the .pyt's properties from the Catalog window was still checked on.&amp;nbsp; (Even after a File &amp;gt; Save and a catalog window refresh)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;class Tool(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.label = "Tool"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.description = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.canRunInBackground = True&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 11.9999990463257px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As soon as I did File &amp;gt; Save As to re-create the .pyt from the IDE everything worked and the custom tool was able to be executed in the background.&amp;nbsp; Just make sure background processing is enabled in Geoprocessing &amp;gt; Geoprocessing options as well.&amp;nbsp; It looks like for existing python toolboxes it does not auto recognize that this option has been changed and it still runs in the foreground despite changes made to the source code.&amp;nbsp; Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-an-option-to-disable-quot-run-python/m-p/597252#M46767</guid>
      <dc:creator>DavidChambers1</dc:creator>
      <dc:date>2021-12-12T01:38:17Z</dc:date>
    </item>
  </channel>
</rss>

