<?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: Problem with a simple if statement in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-with-a-simple-if-statement/m-p/399835#M31520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try printing the value of the button (assuming you are using tkinter):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CheckVar1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If that provides the output you are looking for add that to your if statement:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; CheckVar1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &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;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"pri_oh = 1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&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;&lt;SPAN class="string token"&gt;"pri_oh = 0"&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:15:37 GMT</pubDate>
    <dc:creator>deleted-user-NvcfpBOWaKwr</dc:creator>
    <dc:date>2021-12-11T18:15:37Z</dc:date>
    <item>
      <title>Problem with a simple if statement</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-a-simple-if-statement/m-p/399834#M31519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to Python programming and i am having trouble with a few lines of code that should be easy. The code is below. It is a very simple part of my program.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/476733_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i run this code in PythonWin line 57 puts on my screen a 0 or a 1 depending whether i have selected something in another part of the program. Line 58 prints out the feeder name. Line 59 is the problem. When i print this out it shows that mY_label is equal to "NONE". Why would line 57 show correctly and line 59 does not?&lt;/P&gt;&lt;P&gt;Thanks for any assistance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2019 18:08:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-a-simple-if-statement/m-p/399834#M31519</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-20T18:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a simple if statement</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-a-simple-if-statement/m-p/399835#M31520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try printing the value of the button (assuming you are using tkinter):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CheckVar1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If that provides the output you are looking for add that to your if statement:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; CheckVar1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &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;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"pri_oh = 1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&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;&lt;SPAN class="string token"&gt;"pri_oh = 0"&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:15:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-a-simple-if-statement/m-p/399835#M31520</guid>
      <dc:creator>deleted-user-NvcfpBOWaKwr</dc:creator>
      <dc:date>2021-12-11T18:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a simple if statement</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-a-simple-if-statement/m-p/399836#M31521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeremy,&lt;/P&gt;&lt;P&gt;Thanks a lot for the help. This code worked perfect. I knew it had to be simple but i had run out of ideas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2019 19:30:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-a-simple-if-statement/m-p/399836#M31521</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-20T19:30:47Z</dc:date>
    </item>
  </channel>
</rss>

