<?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 Calling arcpy.env.overwriteOutput in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calling-arcpy-env-overwriteoutput/m-p/192369#M14797</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I go about calling the arcpy.env.overwriteOutput function? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e. [ATTACH=CONFIG]12779[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The print statement clearly shows that it is 'True' but my if else statment is not calling it in the same manner. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 16:00:42 GMT</pubDate>
    <dc:creator>JohanSmith</dc:creator>
    <dc:date>2012-03-16T16:00:42Z</dc:date>
    <item>
      <title>Calling arcpy.env.overwriteOutput</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-env-overwriteoutput/m-p/192369#M14797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I go about calling the arcpy.env.overwriteOutput function? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e. [ATTACH=CONFIG]12779[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The print statement clearly shows that it is 'True' but my if else statment is not calling it in the same manner. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:00:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-env-overwriteoutput/m-p/192369#M14797</guid>
      <dc:creator>JohanSmith</dc:creator>
      <dc:date>2012-03-16T16:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.env.overwriteOutput</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-env-overwriteoutput/m-p/192370#M14798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;== True&lt;/PRE&gt;&lt;SPAN&gt;, not &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;== 'True'&lt;/PRE&gt;&lt;SPAN&gt;, the quotes matter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:04:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-env-overwriteoutput/m-p/192370#M14798</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2012-03-16T16:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.env.overwriteOutput</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-env-overwriteoutput/m-p/192371#M14799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The quotes matter&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason the quotes matter is &lt;/SPAN&gt;&lt;STRONG&gt;arcpy.env.overwriteOutput &lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;is a boolean value, not text,&lt;/SPAN&gt;&lt;SPAN&gt; no matter how you set it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; arcpy.env.overwriteOutput = 'True'
&amp;gt;&amp;gt;&amp;gt; arcpy.env.overwriteOutput
True
&amp;gt;&amp;gt;&amp;gt; arcpy.env.overwriteOutput = 1
&amp;gt;&amp;gt;&amp;gt; arcpy.env.overwriteOutput
True
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fortunately for you, it seems, Esri has set things up so if you set it this property to&amp;nbsp; 'False' (string) it evaluates to False. (Normally in Python, any non-null string evalulates to boolean True.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.env.overwriteOutput = 'False'
&amp;gt;&amp;gt;&amp;gt; arcpy.env.overwriteOutput
False
&amp;gt;&amp;gt;&amp;gt; bool('False')
True&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;since it is boolean type &lt;/SPAN&gt;&lt;SPAN&gt; your original test can be written more simply:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if arcpy.env.overwriteOutput:
&amp;nbsp; print "It is true!"
else:
&amp;nbsp; print "It is false!"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:40:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-env-overwriteoutput/m-p/192371#M14799</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T09:40:08Z</dc:date>
    </item>
  </channel>
</rss>

