<?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: Building a test environment in Python Snippets Questions</title>
    <link>https://community.esri.com/t5/python-snippets-questions/building-a-test-environment/m-p/1676888#M729</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/933934"&gt;@WoodyUmstead&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;First project is to build an automated "save edits" script to run after you start an edit session.&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I hate to be the bearer of bad news, but Python scrips have no ability to hook into Pro events. You can manage edit sessions and apply edits once you've started a script, but the running script will lock you out of interaction with Pro until it completes.&lt;/P&gt;&lt;P&gt;You can write an extension in the C# SDK if you need more direct live access to the machinery of ArcPro though. That's a bit more involved however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want the save edits to be run by the user, I'd start off by creating a simple script tool. That'll give the user a button they can click and allows passing parameters through the standard geoprocessing parameter interface. You'll need the data access (da) module and the management module to accomplish this.&lt;/P&gt;&lt;P&gt;As for the environment, you'll need access to an arcpy conda install. It's usually at:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this environment will make sure that you aren't writing anything that can't be run by a user that only has the default env installed. If you need to add packages, you can create a new env through Pro:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HaydenWelch_0-1767901884476.png" style="width: 746px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/146572i2AD37663639097A0/image-dimensions/746x288?v=v2" width="746" height="288" role="button" title="HaydenWelch_0-1767901884476.png" alt="HaydenWelch_0-1767901884476.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get started, I'd look into the Editor docs:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;as well as the general da docs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll also want to look into creating a ScriptTool:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can have the tool reference a file on disk and package that file into the Toolbox when you need to move it around.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I'm developing tools, I use my own library and pattern to get started. It's published here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/hwelch-fle/pytframe2" target="_blank"&gt;https://github.com/hwelch-fle/pytframe2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I have a supplemental library that's more actively developed here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/hwelch-fle/arcpie" target="_blank"&gt;https://github.com/hwelch-fle/arcpie&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I write most of my code in VSCode and that toolbox system allows me to break tooling into submodules meaning a bug in one tool won't break all tools in the toolbox. This is incredibly useful once your tools hit a production flow and losing the whole system would be catastrophic.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jan 2026 19:55:56 GMT</pubDate>
    <dc:creator>HaydenWelch</dc:creator>
    <dc:date>2026-01-08T19:55:56Z</dc:date>
    <item>
      <title>Building a test environment</title>
      <link>https://community.esri.com/t5/python-snippets-questions/building-a-test-environment/m-p/1676856#M728</link>
      <description>&lt;P&gt;I am new to Python and have a few tasks that my team has been encouraging me to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am nervous and excited to get into this.&lt;/P&gt;&lt;P&gt;Background: 3 years of JavaScript work that was mainly freelance. This is my first Job in GIS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First project is to build an automated "save edits" script to run after you start an edit session.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am wondering, when building my test environment can I just set my 'save path' to somewhere on my local desktop and not to the server? So when I can see that it's saving correctly I can just change the path to our mapping server and bada bing bada boom?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I believe a few packages need to be imported, and I am not sure If that will send a yellow or red flag to our IT dept. We are still new to using scripts and automating at my company.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What are best practices you have found when building test environments?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel silly, really, asking on here. I have spent a while searching for test environments specifically for ARCgis, and what we use is Futura, third party company that has some rebranded tools over ESRI software.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you and any info is good info for me right now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 18:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/building-a-test-environment/m-p/1676856#M728</guid>
      <dc:creator>WoodyUmstead</dc:creator>
      <dc:date>2026-01-08T18:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Building a test environment</title>
      <link>https://community.esri.com/t5/python-snippets-questions/building-a-test-environment/m-p/1676888#M729</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/933934"&gt;@WoodyUmstead&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;First project is to build an automated "save edits" script to run after you start an edit session.&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I hate to be the bearer of bad news, but Python scrips have no ability to hook into Pro events. You can manage edit sessions and apply edits once you've started a script, but the running script will lock you out of interaction with Pro until it completes.&lt;/P&gt;&lt;P&gt;You can write an extension in the C# SDK if you need more direct live access to the machinery of ArcPro though. That's a bit more involved however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want the save edits to be run by the user, I'd start off by creating a simple script tool. That'll give the user a button they can click and allows passing parameters through the standard geoprocessing parameter interface. You'll need the data access (da) module and the management module to accomplish this.&lt;/P&gt;&lt;P&gt;As for the environment, you'll need access to an arcpy conda install. It's usually at:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this environment will make sure that you aren't writing anything that can't be run by a user that only has the default env installed. If you need to add packages, you can create a new env through Pro:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HaydenWelch_0-1767901884476.png" style="width: 746px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/146572i2AD37663639097A0/image-dimensions/746x288?v=v2" width="746" height="288" role="button" title="HaydenWelch_0-1767901884476.png" alt="HaydenWelch_0-1767901884476.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get started, I'd look into the Editor docs:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;as well as the general da docs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll also want to look into creating a ScriptTool:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can have the tool reference a file on disk and package that file into the Toolbox when you need to move it around.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I'm developing tools, I use my own library and pattern to get started. It's published here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/hwelch-fle/pytframe2" target="_blank"&gt;https://github.com/hwelch-fle/pytframe2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I have a supplemental library that's more actively developed here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/hwelch-fle/arcpie" target="_blank"&gt;https://github.com/hwelch-fle/arcpie&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I write most of my code in VSCode and that toolbox system allows me to break tooling into submodules meaning a bug in one tool won't break all tools in the toolbox. This is incredibly useful once your tools hit a production flow and losing the whole system would be catastrophic.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 19:55:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/building-a-test-environment/m-p/1676888#M729</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2026-01-08T19:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Building a test environment</title>
      <link>https://community.esri.com/t5/python-snippets-questions/building-a-test-environment/m-p/1677329#M730</link>
      <description>&lt;P&gt;Eye opening, thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jan 2026 17:19:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/building-a-test-environment/m-p/1677329#M730</guid>
      <dc:creator>WoodyUmstead</dc:creator>
      <dc:date>2026-01-12T17:19:42Z</dc:date>
    </item>
  </channel>
</rss>

