<?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: Calling python scripts in Python Snippets Questions</title>
    <link>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582533#M705</link>
    <description>&lt;P&gt;To call the function "pdf" in the file "ExportPDF.py" in the folder "//spatialfiles2.bcgov/work/FOR/RNI/DPG/!Tenures/Templates/ExhibitA.Pro/Python" the technique is:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sys
sys.path.append(r"\\spatialfiles2.bcgov\work\FOR\RNI\DPG\!Tenures\Templates\ExhibitA.Pro\Python")
from ExportPDF import pdf&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2025 00:44:00 GMT</pubDate>
    <dc:creator>DavidSolari</dc:creator>
    <dc:date>2025-02-06T00:44:00Z</dc:date>
    <item>
      <title>Calling python scripts</title>
      <link>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582520#M704</link>
      <description>&lt;P&gt;Apologies for what might seem simple but...&lt;BR /&gt;In ArcMap, it was simple to call a python script from another using execfile()&lt;/P&gt;&lt;P&gt;I need to recreate that in Pro but nothing I try works.&amp;nbsp; It doesn't matter if I'm calling a .py file or an embedded python script in a project toolbox.&amp;nbsp;&lt;BR /&gt;Some things I have tried:&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#993300"&gt;from "//spatialfiles2.bcgov/work/FOR/RNI/DPG/!Tenures/Templates/ExhibitA.Pro/Python/ExportPDF.py" import pdf&lt;/FONT&gt;&lt;BR /&gt;&lt;/EM&gt;or&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#333300"&gt;&lt;FONT color="#993300"&gt;sys.path.append('\\spatialfiles2.bcgov\work\FOR\RNI\DPG\!Tenures\Templates\ExhibitA.Pro\Python')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;import ExportPDF.py&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;FONT color="#000000"&gt;This is the path to my toolbox:&lt;/FONT&gt;&lt;EM&gt;&lt;FONT color="#333300"&gt;&lt;FONT color="#993300"&gt;&lt;BR /&gt;\\spatialfiles2.bcgov\work\FOR\RNI\DPG\!Tenures\Templates\ExhibitA.Pro\ArcGIS_Pro.atbx&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;FONT color="#333300"&gt;&lt;FONT color="#993300"&gt;&lt;FONT color="#000000"&gt;and the tool I want to call is:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT color="#333300"&gt;&lt;FONT color="#993300"&gt;&lt;BR /&gt;Script2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 00:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582520#M704</guid>
      <dc:creator>DanCrawford</dc:creator>
      <dc:date>2025-02-06T00:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calling python scripts</title>
      <link>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582533#M705</link>
      <description>&lt;P&gt;To call the function "pdf" in the file "ExportPDF.py" in the folder "//spatialfiles2.bcgov/work/FOR/RNI/DPG/!Tenures/Templates/ExhibitA.Pro/Python" the technique is:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sys
sys.path.append(r"\\spatialfiles2.bcgov\work\FOR\RNI\DPG\!Tenures\Templates\ExhibitA.Pro\Python")
from ExportPDF import pdf&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 00:44:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582533#M705</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2025-02-06T00:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calling python scripts</title>
      <link>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582753#M706</link>
      <description>&lt;P&gt;Thank-you, that works without error!&lt;BR /&gt;Something else, if you have time:&lt;BR /&gt;&lt;BR /&gt;While running a script from a Pro toolbox, how do I call another script from the same toolbox?&lt;/P&gt;&lt;P&gt;This is my toolbox path:&lt;BR /&gt;&lt;EM&gt;\\spatialfiles2.bcgov\work\FOR\RNI\DPG\!Tenures\Templates\ExhibitA.Pro\ArcGIS_Pro.atbx&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and the tool I want to run is named SE4Linears&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 17:14:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582753#M706</guid>
      <dc:creator>DanCrawford</dc:creator>
      <dc:date>2025-02-06T17:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calling python scripts</title>
      <link>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582758#M707</link>
      <description>&lt;P&gt;The official docs for &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/importtoolbox.htm" target="_self"&gt;ImportToolbox&lt;/A&gt; should cover that.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 17:21:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582758#M707</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2025-02-06T17:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calling python scripts</title>
      <link>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582797#M708</link>
      <description>&lt;P&gt;Thank-you again.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 18:53:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/calling-python-scripts/m-p/1582797#M708</guid>
      <dc:creator>DanCrawford</dc:creator>
      <dc:date>2025-02-06T18:53:10Z</dc:date>
    </item>
  </channel>
</rss>

