<?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: Workplace Environments in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496310#M38960</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So right you are. I only had the variable in there for troubleshooting this issue, so I tweaked my post to make that clear. Thanks for addressing that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prior to the weekend "workspace" was acting like it was defined. I had no trouble referring to files and setting the workspace: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "arcpy.env.workspace="C:\GIS\ArcHydro\TBR\AH_TBR\AH_TBR.gdb"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEM=workspace+"\DemX10"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;conveyances=workspace+"\Layers\Conveyances"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;walls_internal=workspace+"\Layers\internwalls"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Ponds=workspace+"\Layers\Ponds"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Pourpts=workspace+"\Layers\PourPoints"&lt;/P&gt;&lt;P&gt;I can include what is left of that code. My notebook inside Pro must have not saved correctly on Friday because I lost a lot of work. Is there anychance that a bad save could have had larger ramifications?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Apr 2020 22:44:49 GMT</pubDate>
    <dc:creator>BleysAndromeda-Focht</dc:creator>
    <dc:date>2020-04-27T22:44:49Z</dc:date>
    <item>
      <title>Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496308#M38958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've hit a funny problem, I can't set/access my environment. I did a little research and found a similar problem (&lt;A href="https://community.esri.com/thread/220052"&gt;Not able to set workspace using standalone Python script for ArcGIS&lt;/A&gt;). I know that the script was working because it was it was fully functional for me on Friday, and today it can't find my workspace. I've gone ahead and included a shortened version of my script (and image of the notebook from Pro) that I was working with trying to troubleshoot this issue. It includes a commented out line, and some notes I added for clarity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any ideas, they are all welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Import &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;from arcpy.sa import *&lt;BR /&gt;import os, numpy&lt;BR /&gt;import pandas as pd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Set environments - tried single and double backslashes, there are no spaces in my file name. Assigned file path to variable "w" just for troubleshooting this. That is not part of the code&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;w="C:\\GIS\\ArcHydro\\TBR\\AH_TBR\\AH_TBR.gdb"&lt;BR /&gt;arcpy.env.workspace="C:\\GIS\\ArcHydro\\TBR\\AH_TBR\\AH_TBR.gdb"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Confirmed that arcpy can read the chosen workspace - only from the filepath not from workspace&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;arcpy.Exists("C:\\GIS\\ArcHydro\\TBR\AH_TBR\\AH_TBR.gdb")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Confirm that I can print file path for my variable "w",&lt;/EM&gt;&lt;EM&gt; yet workspace still doesn't exist. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;print (w)&lt;BR /&gt;print (workspace)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Bleys&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2020 20:44:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496308#M38958</guid>
      <dc:creator>BleysAndromeda-Focht</dc:creator>
      <dc:date>2020-04-27T20:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496309#M38959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;workspace isn't defined... w is and arcpy.env.workspace is.&amp;nbsp; You can't do the 'workspace' shortcut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2020 22:12:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496309#M38959</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-04-27T22:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496310#M38960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So right you are. I only had the variable in there for troubleshooting this issue, so I tweaked my post to make that clear. Thanks for addressing that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prior to the weekend "workspace" was acting like it was defined. I had no trouble referring to files and setting the workspace: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "arcpy.env.workspace="C:\GIS\ArcHydro\TBR\AH_TBR\AH_TBR.gdb"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEM=workspace+"\DemX10"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;conveyances=workspace+"\Layers\Conveyances"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;walls_internal=workspace+"\Layers\internwalls"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Ponds=workspace+"\Layers\Ponds"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Pourpts=workspace+"\Layers\PourPoints"&lt;/P&gt;&lt;P&gt;I can include what is left of that code. My notebook inside Pro must have not saved correctly on Friday because I lost a lot of work. Is there anychance that a bad save could have had larger ramifications?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2020 22:44:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496310#M38960</guid>
      <dc:creator>BleysAndromeda-Focht</dc:creator>
      <dc:date>2020-04-27T22:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496311#M38961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No.&amp;nbsp; You must have defined 'workspace' earlier on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Git_Dan\npgeom\Project_npg\npgeom.gdb"&lt;/SPAN&gt;
workspace
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-6-91a042f38ba6&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
 workspace
NameError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; name &lt;SPAN class="string token"&gt;'workspace'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; defined&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496311#M38961</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T21:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496312#M38962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am defining the workspace on my second line of code after calling arcpy with my first line of code defining the ArcHydro toolbox. I must be missing something, especially because the code ran with no issues on Friday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/490132_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2020 23:31:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496312#M38962</guid>
      <dc:creator>BleysAndromeda-Focht</dc:creator>
      <dc:date>2020-04-27T23:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496313#M38963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#Import&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; numpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; pandas &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; pd

 

&lt;SPAN class="string token"&gt;'''Set environments - tried single and double backslashes, there are no spaces in my file name. Assigned file path to variable "w" just for troubleshooting this. That is not part of the code
'''&lt;/SPAN&gt;

w&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"C:\\GIS\\ArcHydro\\TBR\\AH_TBR\\AH_TBR.gdb"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"C:\\GIS\\ArcHydro\\TBR\\AH_TBR\\AH_TBR.gdb"&lt;/SPAN&gt;

 

&lt;SPAN class="string token"&gt;'''Confirmed that arcpy can read the chosen workspace - only from the filepath not from workspace
'''&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"C:\\GIS\\ArcHydro\\TBR\AH_TBR\\AH_TBR.gdb"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

 
&lt;SPAN class="string token"&gt;'''
Confirm that I can print file path for my variable "w", yet workspace still doesn't exist.
'''&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;w&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I took the liberty of formatting your code so it's more easily readable.&amp;nbsp; Please do the same thing in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Dan mentions, no where in your code do you set a variable called workspace. Line 14 you set w but not workspace.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You&amp;nbsp;should get into the habit of using r strings which is raw text.&amp;nbsp; That way you can just copy and paste your paths and never ever have to worry about which slash to use or escape:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;myFolder &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\some\path\to\a\folder'&lt;/SPAN&gt;‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:49:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496313#M38963</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T21:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496314#M38964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;examine lines 74 - 76&lt;/P&gt;&lt;P&gt;Nowhere do you define a variable named "workspace"&lt;/P&gt;&lt;P&gt;Examine my example as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 00:00:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496314#M38964</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-04-28T00:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496315#M38965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for reformatting my text for readability. I am really, really sorry I ever included the variable "&lt;EM&gt;w"&lt;/EM&gt;. It just made stuff confusing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When my code was functioning last week, I was able to print (workspace) and it would print the path to the workspace, that is why I was using the print function; only to troubleshoot my own code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script was not finding my feature classes inside of the workspace when I attempted to rerun the code from last week, saying that workspace was not defined. Converting my file paths to raw text seemed to be the fix. Then Pro crashed on me and it is no longer working. The code dies on line 3, when I define my DEM to use. This was working fine for last week and so I am not quite sure would have changed. &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#Import&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; numpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; pandas &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; pd
AH&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ImportToolbox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Arc_Hydro_Tools_Pro.tbx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#Set env &amp;amp; variables&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\GIS\ArcHydro\TBR\AH_TBR\AH_TBR.gdb"&lt;/SPAN&gt;
folderspace&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\\GIS\ArcHydro\\TBR\\AH_TBR\\"&lt;/SPAN&gt;
DEM&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;workspace&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"\DemX10"&lt;/SPAN&gt;
conveyances&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;workspace&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"\Layers\Conveyances"&lt;/SPAN&gt;
walls_internal&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;workspace&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"\Layers\internwalls"&lt;/SPAN&gt;
Ponds&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;workspace&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"\Layers\Ponds"&lt;/SPAN&gt;
Pourpts&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;workspace&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"\Layers\PourPoints"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;snapRaster&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;DEM
&lt;SPAN class="comment token"&gt;#NAD 27 Alaska State Plane Zone 4 WKID Code: 26734&lt;/SPAN&gt;
sr&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;26734&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outputCoordinateSystem&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;sr
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Convert FC to Rast&lt;/SPAN&gt;
rast_convey&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;folderspace&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\\Layers\\convey_rast.tif"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conversion&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureToRaster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;conveyances&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TYPE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; rast_convey&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Fill Raster&lt;/SPAN&gt;
Fill_1_out&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;folderspace&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\\Layers\\fil3.tif"&lt;/SPAN&gt;
AH&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FillSinks&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;DEM&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;Fill_1_out&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Ponds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:49:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496315#M38965</guid>
      <dc:creator>BleysAndromeda-Focht</dc:creator>
      <dc:date>2021-12-11T21:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496316#M38966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;emulate...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;workspace = arcpy.env.workspace = r"C:\Git_Dan\npgeom\Project_npg\npgeom.gdb"
print(workspace)
C:\Git_Dan\npgeom\Project_npg\npgeom.gdb&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:49:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496316#M38966</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T21:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496317#M38967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked perfectly. Thank you. &lt;BR /&gt;The bigger question for me now is why was I able to use "workspace" before without properly defining it before using it. I sure feel lame for missing the obvious answer here, thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 00:51:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496317#M38967</guid>
      <dc:creator>BleysAndromeda-Focht</dc:creator>
      <dc:date>2020-04-28T00:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496318#M38968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess?&amp;nbsp;&lt;/P&gt;&lt;P&gt;You defined 'workspace' as a variable it during the python session... maybe before shortening it to 'w'.&lt;/P&gt;&lt;P&gt;The name,&amp;nbsp; 'workspace' renames in the python namespace until the session is closed... not the script ends, but python is shutdown.&lt;/P&gt;&lt;P&gt;If you used a python IDE, like spyder that stores your history, you can review all your definitions and changes when you need to track down answers to mysteries.&lt;/P&gt;&lt;P&gt;Otherwise,&amp;nbsp;The true answer will come in a dream &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 01:02:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496318#M38968</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-04-28T01:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496319#M38969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to avoid naming variables that are included in function names.&amp;nbsp; For example:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;string &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'abcde'&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;#no no&lt;/SPAN&gt;
theString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'abcde'&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;#better&lt;/SPAN&gt;

workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;  r&lt;SPAN class="string token"&gt;'C:\blah\blah\blah\fgdb.gdb'&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;#nope&lt;/SPAN&gt;
ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\blah\blah\blah\fgdb.gdb'&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ws&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:49:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496319#M38969</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T21:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496320#M38970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan. After sleeping on it I realize that I tricked myself into thinking that "workspace" was akin to a reserved variable in arcpy. Thus I wouldn't need to define the variable, just assign it via the arcpy.env.workspace and then use it freely the rest of the time. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:13:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496320#M38970</guid>
      <dc:creator>BleysAndromeda-Focht</dc:creator>
      <dc:date>2020-04-28T15:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Workplace Environments</title>
      <link>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496321#M38971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shall I mark this as "Assumed Answered" to close the thread or did one provide the solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:51:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/workplace-environments/m-p/496321#M38971</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-04-30T07:51:43Z</dc:date>
    </item>
  </channel>
</rss>

