<?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: Migrating Python 2.7 From Desktop to 3.1 for Pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1372709#M77696</link>
    <description>&lt;P&gt;A few others thing that is sort of confusing is that the Python has an&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/3.1/arcpy/get-started/setting-paths-to-data.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/3.1/arcpy/get-started/setting-paths-to-data.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;\\ versus \ standard&lt;/P&gt;&lt;P&gt;It seems when you do do an 'r' command you use a single slash.&lt;/P&gt;&lt;P&gt;When you just declare a path is what a variable is equal to, you use a \\&lt;/P&gt;&lt;P&gt;1. Is that correct?&lt;/P&gt;&lt;P&gt;2. I also noticed you can specify a path as the env.workspace, as your Windows path you are referring to.&lt;/P&gt;&lt;P&gt;but it appears that you can't use it as a tack on variable when doing a read.&lt;/P&gt;&lt;P&gt;so&amp;nbsp;&amp;nbsp; placeholdervariableforshapedotshp= r+env.workspace+"\shapefiles\shape.shp" won't work because the env.workspace is declared with \\&lt;/P&gt;&lt;P&gt;I had tried to create an renvworkspace =&amp;nbsp; pathtoworkspace described with single slashes, and that doesn't appear to work either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me where I am assuming wrong?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Jan 2024 03:23:25 GMT</pubDate>
    <dc:creator>Cartographer7</dc:creator>
    <dc:date>2024-01-21T03:23:25Z</dc:date>
    <item>
      <title>Migrating Python 2.7 From Desktop to 3.1 for Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1366125#M76929</link>
      <description>&lt;P&gt;We've been running ArcGIS Desktop with Python 2.7 and intend to migrate to ArcGIS Pro with Python 3.1 before the switchover in April:&lt;/P&gt;&lt;P&gt;1. Can Modelbuilder import Python scripts and make a model based on the scripts if they run successfully using the runtime of ArcGIS Desktop?&lt;/P&gt;&lt;P&gt;2. Can Python 2.7 scripts be migrated to ArcGIS Pro without editing, or are there syntax differences to be aware of?&lt;/P&gt;&lt;P&gt;3. Can MXDs with shapefiles be migrated easily from one platform to the next?&amp;nbsp; Are there any significant syntax differences in the operands of each Arc platform?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 03:25:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1366125#M76929</guid>
      <dc:creator>Cartographer7</dc:creator>
      <dc:date>2024-01-04T03:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating Python 2.7 From Desktop to 3.1 for Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1366229#M76946</link>
      <description>&lt;P&gt;Some of your questions can be answered from this help topic and its sub-links&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/get-started/migrate-to-arcgis-pro.htm" target="_blank"&gt;For ArcMap users migrating to ArcGIS Pro—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 12:57:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1366229#M76946</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-01-04T12:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating Python 2.7 From Desktop to 3.1 for Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1366274#M76951</link>
      <description>&lt;P&gt;I'm not a Python person, but I dug up some info from an old email that might help you (we're moving from ArcMap 10.7.1 and ArcGIS Pro 2.6.8 —to— ArcGIS Pro 3x):&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;I found this article described the changes very well: &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/python-migration-for-arcgis-pro.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/python-migration-for-arcgis-pro.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There’s actually a GP tool in ArcGIS Pro called “Analyze Tools for Pro” that can analyze your python scripts to see if they are Python 3/Pro compatible:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1704379598245.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/90507i80805B61F98D4BA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1704379598245.png" alt="Bud_0-1704379598245.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When we ran that tool against one of our scripts, the only issues it identified there were the “print” statements… they need to have brackets in Python 3.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 14:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1366274#M76951</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-01-04T14:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating Python 2.7 From Desktop to 3.1 for Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1371421#M77557</link>
      <description>&lt;P&gt;Well that was certainly a start.&amp;nbsp; I even got &lt;A href="https://docs.python.org/3/library/2to3.html" target="_blank" rel="noopener"&gt;https://docs.python.org/3/library/2to3.html&lt;/A&gt; script to run.&lt;/P&gt;&lt;P&gt;But Analyze Tools for Pro stalls at 3%.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And looking at the output of running my revised script, SpatialJoin seems to call a script from the User home folder even though the original script is somewhere completely different, on a shared drive.&lt;/P&gt;&lt;P&gt;It calls a _base.py and an analysis.py, neither of which are in my original script.&amp;nbsp; It did a SpatialJoin quite easily under ArcMap 10.8.2.&amp;nbsp; So I need to know how to do a Spatial Join call in ArcPy Python 3.1?&lt;/P&gt;&lt;P&gt;Also based on the output has ArcGIS Pro removed DBF support in its python scripts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 02:58:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1371421#M77557</guid>
      <dc:creator>Cartographer7</dc:creator>
      <dc:date>2024-01-18T02:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating Python 2.7 From Desktop to 3.1 for Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1371526#M77569</link>
      <description>&lt;P&gt;Every tool, under Parameters, has a Dialog and python tab&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/spatial-join.htm" target="_blank"&gt;Spatial Join (Analysis)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;code examples are in the python tab&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 09:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1371526#M77569</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-01-18T09:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating Python 2.7 From Desktop to 3.1 for Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1372709#M77696</link>
      <description>&lt;P&gt;A few others thing that is sort of confusing is that the Python has an&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/3.1/arcpy/get-started/setting-paths-to-data.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/3.1/arcpy/get-started/setting-paths-to-data.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;\\ versus \ standard&lt;/P&gt;&lt;P&gt;It seems when you do do an 'r' command you use a single slash.&lt;/P&gt;&lt;P&gt;When you just declare a path is what a variable is equal to, you use a \\&lt;/P&gt;&lt;P&gt;1. Is that correct?&lt;/P&gt;&lt;P&gt;2. I also noticed you can specify a path as the env.workspace, as your Windows path you are referring to.&lt;/P&gt;&lt;P&gt;but it appears that you can't use it as a tack on variable when doing a read.&lt;/P&gt;&lt;P&gt;so&amp;nbsp;&amp;nbsp; placeholdervariableforshapedotshp= r+env.workspace+"\shapefiles\shape.shp" won't work because the env.workspace is declared with \\&lt;/P&gt;&lt;P&gt;I had tried to create an renvworkspace =&amp;nbsp; pathtoworkspace described with single slashes, and that doesn't appear to work either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me where I am assuming wrong?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jan 2024 03:23:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1372709#M77696</guid>
      <dc:creator>Cartographer7</dc:creator>
      <dc:date>2024-01-21T03:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating Python 2.7 From Desktop to 3.1 for Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1372722#M77699</link>
      <description>&lt;P&gt;These work&lt;/P&gt;&lt;LI-CODE lang="python"&gt;c:\\temp\\poly.png
c:/temp/poly.png
r"c:\temp\poly.png"

arcpy.env.workspace = r"c:\temp"
image_file = "{}".format(arcpy.env.workspace) + r"\poly.png"

image_file
'c:\\Temp\\poly.png'

image_file = rf"{arcpy.env.workspace}" + r"\poly.png"

image_file
'c:\\Temp\\poly.png'&lt;/LI-CODE&gt;&lt;P&gt;1, 2 ... windows, "linux"&lt;/P&gt;&lt;P&gt;3 .... "raw" format&lt;/P&gt;&lt;P&gt;5,6,&amp;nbsp; and 5,11&amp;nbsp; two variants of "f-string" formatting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jan 2024 10:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/migrating-python-2-7-from-desktop-to-3-1-for-pro/m-p/1372722#M77699</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-01-21T10:54:12Z</dc:date>
    </item>
  </channel>
</rss>

