<?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 Import Custom Script Into ToolValidator Class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/import-custom-script-into-toolvalidator-class/m-p/233668#M18138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am setting up a geoprocessing tool based on a Python script and need to implement some fairly complex logic in the ToolValidator class.&amp;nbsp; I have already created another module/script that includes this logic, and would like to use it in the ToolValidator class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to import the script by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;sys.path.append('my_script_dir')
import my_script&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, as soon as I try to save changes in the ToolValidator, I am hit with a runtime error:&amp;nbsp; [Errno 9] Bad file descriptor.&amp;nbsp; If I comment out the import statement, no error occurs when I apply changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how I can import a custom (non-installed) script into the ToolValidator class?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Apr 2011 15:37:24 GMT</pubDate>
    <dc:creator>RafaelFerraro</dc:creator>
    <dc:date>2011-04-18T15:37:24Z</dc:date>
    <item>
      <title>Import Custom Script Into ToolValidator Class</title>
      <link>https://community.esri.com/t5/python-questions/import-custom-script-into-toolvalidator-class/m-p/233668#M18138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am setting up a geoprocessing tool based on a Python script and need to implement some fairly complex logic in the ToolValidator class.&amp;nbsp; I have already created another module/script that includes this logic, and would like to use it in the ToolValidator class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to import the script by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;sys.path.append('my_script_dir')
import my_script&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, as soon as I try to save changes in the ToolValidator, I am hit with a runtime error:&amp;nbsp; [Errno 9] Bad file descriptor.&amp;nbsp; If I comment out the import statement, no error occurs when I apply changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how I can import a custom (non-installed) script into the ToolValidator class?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 15:37:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-custom-script-into-toolvalidator-class/m-p/233668#M18138</guid>
      <dc:creator>RafaelFerraro</dc:creator>
      <dc:date>2011-04-18T15:37:24Z</dc:date>
    </item>
  </channel>
</rss>

