<?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: Importing a module from an embedded script tool? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042739#M60611</link>
    <description>&lt;P&gt;include all your code in the py attached to the tbx and encrypt it or&lt;/P&gt;&lt;P&gt;use a pyt and encrypt it&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/encryptpyt.htm" target="_blank"&gt;EncryptPYT—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can import toolboxes, list tools etc from arcpy as well... for example&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/importtoolbox.htm" target="_blank"&gt;ImportToolbox—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you intend to use your code outside of the arcpy environment you will have to use one of the available encryption modules found on the web.&lt;/P&gt;&lt;P&gt;A good license is a better way of maintaining intellectual property rights.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examine the packages on GitHub for examples of how to maintain open code with preserved rights and even options for economic support for projects.&lt;/P&gt;&lt;P&gt;Be aware the nothing is fully secure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Apr 2021 04:05:55 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-04-01T04:05:55Z</dc:date>
    <item>
      <title>Importing a module from an embedded script tool?</title>
      <link>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042707#M60608</link>
      <description>&lt;P&gt;I have a script that I imported into a toolbox (.tbx), so the script file is now embedded. My question is, how do I import the modules from this embedded script file so that my imported script tools run without the "ModuleNotFoundError"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything works fine if I don't import the script and just provide the path in the script tool properties, but I can't figure out how to get things working when the script file is embedded into the toolbox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 01:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042707#M60608</guid>
      <dc:creator>GB_MattPanunto_GISS</dc:creator>
      <dc:date>2021-04-01T01:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a module from an embedded script tool?</title>
      <link>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042733#M60609</link>
      <description>&lt;P&gt;Not sure why you want to import the script that is used to run the toolbox.&amp;nbsp; Embedding it, places it inside the tbx, there is no need to import it.&amp;nbsp; If you are importing other modules (aka, scripts) you can do that in the main script associated with the toolbox.&lt;/P&gt;&lt;P&gt;The safest layout is to create a folder with your tbx, main script and supporting scripts in it.&lt;/P&gt;&lt;P&gt;Are you attempting to encrypt/hide the source code for the main script?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 02:44:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042733#M60609</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-01T02:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a module from an embedded script tool?</title>
      <link>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042736#M60610</link>
      <description>&lt;P&gt;Yes, encrypting/hiding the code is exactly what I want to do here.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 03:51:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042736#M60610</guid>
      <dc:creator>GB_MattPanunto_GISS</dc:creator>
      <dc:date>2021-04-01T03:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a module from an embedded script tool?</title>
      <link>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042739#M60611</link>
      <description>&lt;P&gt;include all your code in the py attached to the tbx and encrypt it or&lt;/P&gt;&lt;P&gt;use a pyt and encrypt it&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/encryptpyt.htm" target="_blank"&gt;EncryptPYT—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can import toolboxes, list tools etc from arcpy as well... for example&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/importtoolbox.htm" target="_blank"&gt;ImportToolbox—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you intend to use your code outside of the arcpy environment you will have to use one of the available encryption modules found on the web.&lt;/P&gt;&lt;P&gt;A good license is a better way of maintaining intellectual property rights.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examine the packages on GitHub for examples of how to maintain open code with preserved rights and even options for economic support for projects.&lt;/P&gt;&lt;P&gt;Be aware the nothing is fully secure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 04:05:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importing-a-module-from-an-embedded-script-tool/m-p/1042739#M60611</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-01T04:05:55Z</dc:date>
    </item>
  </channel>
</rss>

