<?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: Retrieve Python window code from previous session in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18048#M1423</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darren,&lt;/P&gt;&lt;P&gt;In ArcGIS Pro there is. If you look under the folder C:\Users\&amp;lt;user_name&amp;gt;\AppData\Local\ESRI\Local Caches, there is a file name py_repl.history that includes code run from the Python window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 May 2016 21:41:11 GMT</pubDate>
    <dc:creator>DavidWynne</dc:creator>
    <dc:date>2016-05-31T21:41:11Z</dc:date>
    <item>
      <title>Retrieve Python window code from previous session</title>
      <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18045#M1420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any way to retrieve Python code entered and executed in the Python window from a previous session, similar to Results? The situation is that I was debugging what evolved into a somewhat convoluted section of code, and then crashed ArcMap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 18:12:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18045#M1420</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-05-31T18:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Python window code from previous session</title>
      <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18046#M1421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the Python window, right-click and "Save as".&amp;nbsp; This will save all the typed commands...working or not, without all the returned messages.&amp;nbsp; You can then clean up the file, and actually "Load" it to have it execute in the window again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I have the "Add to Results" checked, so anything that runs here is also added to the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, if it crashes before you get to save, or close out successfully (for the results)...I'm not sure, and would also be curious.&amp;nbsp; Maybe you can have a script that always does an auto "Save as"???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 19:02:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18046#M1421</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-31T19:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Python window code from previous session</title>
      <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18047#M1422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Rebecca. I wasn't aware that there was a right-click context menu for the Python window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current "safety" method is to select my script and copy/paste to an external text editor in case of crash. I don't necessarily want to save script files for all my scratch scripts, and using "Save As..." I would still have to remember to do it before a crash. "Add to Results" only adds geoprocessing tool runs, and my scripts are generally more cursor-based, so that doesn't quite do what I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In any case, I suppose the answer is to do the bulk of my work in a proper IDE that doesn't crash nearly as often as ArcMap, and also enables my compulsive "Ctrl+S" saving habit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: I'm still holding out hope that someone knows of a secret log file that records Python window activity.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 20:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18047#M1422</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-05-31T20:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Python window code from previous session</title>
      <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18048#M1423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darren,&lt;/P&gt;&lt;P&gt;In ArcGIS Pro there is. If you look under the folder C:\Users\&amp;lt;user_name&amp;gt;\AppData\Local\ESRI\Local Caches, there is a file name py_repl.history that includes code run from the Python window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 21:41:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18048#M1423</guid>
      <dc:creator>DavidWynne</dc:creator>
      <dc:date>2016-05-31T21:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Python window code from previous session</title>
      <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18049#M1424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh, thanks, David. It doesn't look like this exists at 10.2.2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 21:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18049#M1424</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-05-31T21:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Python window code from previous session</title>
      <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18050#M1425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can relate.....really bums me out after long stretch of testing to have it crash and lose everything.&amp;nbsp; I do the same as you many times...mass copy-paste.&amp;nbsp; Nice thing about the SaveAs however, you don't have to clean up all the &amp;gt;&amp;gt; and returned messages....just what you typed.&amp;nbsp; So worth it when you remember.&amp;nbsp; Many times my script rely on the open MXD so can't always strictly use the IDE (I use Wing Pro myself)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But good to know it already exists in ArcGIS Pro....if it does actually keep it as you go, and doesn't rely on a clean exit (i.e. if it saves even with a crash....)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 22:03:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18050#M1425</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-31T22:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Python window code from previous session</title>
      <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18051#M1426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, it's only in ArcGIS Pro. In ArcMap, you'd have to save as you go as &lt;A href="https://community.esri.com/migrated-users/195597"&gt;Rebecca Strauch&lt;/A&gt;​ suggested, as the code isn't retained.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 22:07:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18051#M1426</guid>
      <dc:creator>DavidWynne</dc:creator>
      <dc:date>2016-05-31T22:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Python window code from previous session</title>
      <link>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18052#M1427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out &lt;A href="https://community.esri.com/ideas/1447" target="_blank"&gt;https://community.esri.com/ideas/1447&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;As mention, the old "&amp;amp;watch"&amp;nbsp; or maybe "&amp;amp;echo on". &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2021 08:16:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/retrieve-python-window-code-from-previous-session/m-p/18052#M1427</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-06-22T08:16:44Z</dc:date>
    </item>
  </channel>
</rss>

