<?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: Intermediate data in stand-alone Python scripts in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251284#M66656</link>
    <description>&lt;P&gt;You can.&amp;nbsp; And it takes some trial and error for the placement of the slash since sometimes just memory works, and other times, you need to add it to the beginning.&amp;nbsp; There is a question on here posted not too long ago that demonstrates how arcpy.Exists() will either fail or resolve depending on the leadning /.&amp;nbsp; There isn't any mention in the docs about the leading /, but the interpreter doesn't lie.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/existence-of-data-in-memory-and-in-memory/m-p/1248259#M66564" target="_blank" rel="noopener"&gt;existence-of-data-in-memory-and-in-memory&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 14:35:51 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2023-01-25T14:35:51Z</dc:date>
    <item>
      <title>Intermediate data in stand-alone Python scripts</title>
      <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251264#M66653</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is it possible to write to memory in stand-alone Python scripts using&amp;nbsp;&lt;STRONG&gt;\memory&lt;/STRONG&gt;? I haven't been able to get it to work but I thought that this was possible. If not, what is a good practice for dealing with intermediate data in stand-alone scripts?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nicole&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:15:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251264#M66653</guid>
      <dc:creator>NSamu</dc:creator>
      <dc:date>2023-01-25T14:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Intermediate data in stand-alone Python scripts</title>
      <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251278#M66654</link>
      <description>&lt;P&gt;Think it's possible:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:26:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251278#M66654</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2023-01-25T14:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Intermediate data in stand-alone Python scripts</title>
      <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251280#M66655</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/511889"&gt;@NSamu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like your / is out of place. Try having your path beginning with memory&lt;STRONG&gt;/&lt;/STRONG&gt; and take a look at our documentation on this topic &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm" target="_self"&gt;here.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Taren&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251280#M66655</guid>
      <dc:creator>Taren_Esri</dc:creator>
      <dc:date>2023-01-25T14:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Intermediate data in stand-alone Python scripts</title>
      <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251284#M66656</link>
      <description>&lt;P&gt;You can.&amp;nbsp; And it takes some trial and error for the placement of the slash since sometimes just memory works, and other times, you need to add it to the beginning.&amp;nbsp; There is a question on here posted not too long ago that demonstrates how arcpy.Exists() will either fail or resolve depending on the leadning /.&amp;nbsp; There isn't any mention in the docs about the leading /, but the interpreter doesn't lie.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/existence-of-data-in-memory-and-in-memory/m-p/1248259#M66564" target="_blank" rel="noopener"&gt;existence-of-data-in-memory-and-in-memory&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251284#M66656</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-25T14:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Intermediate data in stand-alone Python scripts</title>
      <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251288#M66657</link>
      <description>&lt;P&gt;Thank you. I read the documentation but wasn't clear about whether or not you could use &lt;STRONG&gt;/memory&lt;/STRONG&gt; in standalone scripts but I do use it quite a bit inside of Pro. Glad to know that this is possible.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:41:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251288#M66657</guid>
      <dc:creator>NSamu</dc:creator>
      <dc:date>2023-01-25T14:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Intermediate data in stand-alone Python scripts</title>
      <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251289#M66658</link>
      <description>&lt;P&gt;Hi Nicole,&lt;/P&gt;&lt;P&gt;What error(s) are you seeing and what version of ArcGIS are you using? That should work for geoprocessing tools in stand-alone scripts.&lt;/P&gt;&lt;P&gt;A non-arcpy (gasp!) alternative is to use the python tempfile library to create a temporary file or directory, and use it to store intermediate data:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import tempfile

temp_file = tempfile.NamedTemporaryFile()
print(temp_file.name) # prints the path of the created temporary file

# ... do something with the temporary file ...

temp_file.close() # deletes the file&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is stored on disk, so the performance benefits don't apply, but this is a similarly clean way to keep your scripts from needlessly cluttering up your workspace. I've seen this used very effectively.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:42:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251289#M66658</guid>
      <dc:creator>DannyMcVey</dc:creator>
      <dc:date>2023-01-25T14:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Intermediate data in stand-alone Python scripts</title>
      <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251291#M66659</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;@Anonymous User. I appreciate the clarification. I will trial/error with and without the leading slash in stand-alone scripts.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:43:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251291#M66659</guid>
      <dc:creator>NSamu</dc:creator>
      <dc:date>2023-01-25T14:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Intermediate data in stand-alone Python scripts</title>
      <link>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251460#M66666</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/186236"&gt;@DannyMcVey&lt;/a&gt;&amp;nbsp;, thank you for this suggestion. I appreciate it. I may end up doing that since writing to memory is still being a finicky from the stand-alone script. Here's the error (I took out part of the file paths for privacy reasons).&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "P:/GISData/.../Create_IDBData.py", line 8, in &amp;lt;module&amp;gt;&lt;BR /&gt;arcpy.management.PolygonToLine(r"P:\DatabaseConnection\....DBO.TNCountyBoundary", r"\memory\county_line_temp", "IGNORE_NEIGHBORS")&lt;BR /&gt;File "C:\Users\nsamu\AppData\Local\Programs\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4664, in PolygonToLine&lt;BR /&gt;raise e&lt;BR /&gt;File "C:\Users\...ArcPy\arcpy\management.py", line 4661, in PolygonToLine&lt;BR /&gt;retval = convertArcObjectToPythonObject(gp.PolygonToLine_management(*gp_fixargs((in_features, out_feature_class, neighbor_option), True)))&lt;BR /&gt;File "C:\Users\...\AppData\Local\Programs\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: ERROR 000210: Cannot create output \memory\county_line_temp&lt;BR /&gt;Failed to execute (PolygonToLine).&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 18:19:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intermediate-data-in-stand-alone-python-scripts/m-p/1251460#M66666</guid>
      <dc:creator>NSamu</dc:creator>
      <dc:date>2023-01-25T18:19:11Z</dc:date>
    </item>
  </channel>
</rss>

