<?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: Python Labeling Help? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155924#M12016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My friends, here are some ideas on how to take advantage of Python's very handy string abilities...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def report(clr, lbl, val):
&amp;nbsp; return "&amp;lt;bol&amp;gt;&amp;lt;clr {} = '255'&amp;gt;{}: {}&amp;lt;/clr&amp;gt;&amp;lt;/bol&amp;gt;\n".format(
&amp;nbsp;&amp;nbsp;&amp;nbsp; clr, lbl, val)
def FindLabel([NAME], [Acetone], [Benzene], [1_3_Butadi]):
&amp;nbsp; message = ""
&amp;nbsp; if int([Benzene]) &amp;gt; 79:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message += report("red", "Benzene", [Benzene])
&amp;nbsp; elif int([Benzene]) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message += report("green", "Benzene", [Benzene]) 
&amp;nbsp; if [Acetone] &amp;gt; 0:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message += report("green", "Acetone", [Acetone])
&amp;nbsp; if int([1_3_Butadi]) &amp;gt; 0:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message += report("green", "1,3-Butadiene", [1_3_Butadi])
&amp;nbsp; return message &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(If you start a table, dataset, or field name with a number, you may regret it. &lt;EM&gt;You have been warned.&lt;/EM&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 08:17:00 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-12-11T08:17:00Z</dc:date>
    <item>
      <title>Python Labeling Help?</title>
      <link>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155918#M12010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to write a python script to label multiple columns of an attribute table based on certain parameters. For example, if Benzene is over 79, I want it to be red. I've gotten that part fine, but for some reason I can't get the labels to stack, it only displays the first one the meets the if/then statement. Here's what I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def FindLabel ( [NAME], [Acetone], [Benzene], [1_3_Butadi]&amp;nbsp; ):
&amp;nbsp; if int( [Benzene] ) &amp;gt; 79:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "&amp;lt;bol&amp;gt;" "&amp;lt;clr red = '255'&amp;gt;"+"Benzene:" + [Benzene] + "&amp;lt;/clr&amp;gt;" + "&amp;lt;/bol&amp;gt;"+ "\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; return message + "\n"
&amp;nbsp; if int( [Benzene] ) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "&amp;lt;bol&amp;gt;" "&amp;lt;clr green = '255'&amp;gt;"+"Benzene:" + [Benzene] + "&amp;lt;/clr&amp;gt;" + "&amp;lt;/bol&amp;gt;"+ "\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; return message + "\n"
&amp;nbsp; if int( [Acetone] ) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "&amp;lt;bol&amp;gt;" "&amp;lt;clr green = '255'&amp;gt;"+"Acetone:" + [Acetone] + "&amp;lt;/clr&amp;gt;" + "&amp;lt;/bol&amp;gt;" + "\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; return message + "\n"
&amp;nbsp; if int( [1_3_Butadi]&amp;nbsp; ) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "&amp;lt;bol&amp;gt;" "&amp;lt;clr green = '255'&amp;gt;"+"1,3-Butadiene:" + [1_3_Butadi]&amp;nbsp; + "&amp;lt;/clr&amp;gt;" + "&amp;lt;/bol&amp;gt;"+ "\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; return message + "\n"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I essentially want it to display like this &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;Benzene: 79&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;Acetone: 12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;1,3-Butadiene:13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;I tried using:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; return "{0}\n{1}".format([Acetone], [Benzene], [1_3_Butadi])&lt;/PRE&gt;&lt;P&gt;That allowed me to stack the labels but then I lost the formatting I wanted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:16:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155918#M12010</guid>
      <dc:creator>MattBrauckmann</dc:creator>
      <dc:date>2021-12-11T08:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python Labeling Help?</title>
      <link>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155919#M12011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to build your message. I didn't test the code below but your code should be similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def FindLabel ( [NAME], [Acetone], [Benzene], [1_3_Butadi]&amp;nbsp; ):
&amp;nbsp; message = ''
&amp;nbsp; if int( [Benzene] ) &amp;gt; 79:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + "&amp;lt;bol&amp;gt;" "&amp;lt;clr red = '255'&amp;gt;"+"Benzene:" + [Benzene] + "&amp;lt;/clr&amp;gt;" + "&amp;lt;/bol&amp;gt;"+ "\n"&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + "\n"&amp;nbsp; 
&amp;nbsp; if int( [Benzene] ) &amp;gt; 0:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + "&amp;lt;bol&amp;gt;" "&amp;lt;clr green = '255'&amp;gt;"+"Benzene:" + [Benzene] + "&amp;lt;/clr&amp;gt;" + "&amp;lt;/bol&amp;gt;"+ "\n"&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + "\n"&amp;nbsp; 
&amp;nbsp; if int( [Acetone] ) &amp;gt; 0:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + "&amp;lt;bol&amp;gt;" "&amp;lt;clr green = '255'&amp;gt;"+"Acetone:" + [Acetone] + "&amp;lt;/clr&amp;gt;" + "&amp;lt;/bol&amp;gt;" + "\n"&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + "\n"&amp;nbsp; 
&amp;nbsp; if int( [1_3_Butadi]&amp;nbsp; ) &amp;gt; 0:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + "&amp;lt;bol&amp;gt;" "&amp;lt;clr green = '255'&amp;gt;"+"1,3-Butadiene:" + [1_3_Butadi]&amp;nbsp; + "&amp;lt;/clr&amp;gt;" + "&amp;lt;/bol&amp;gt;"+ "\n"&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + "\n"
&amp;nbsp; return message&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:16:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155919#M12011</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-11T08:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Python Labeling Help?</title>
      <link>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155920#M12012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;I see you've got your answer, however I think you can benefit from an 'elif' between the Benzene comparisons. Without 'elif', a value of 80 will get a red label (&amp;gt;79) followed by a green label (&amp;gt;0). With 'elif', a value of 80 will get a red label, then skip the &amp;gt;0 comparison:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;def&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; FindLabel ( [NAME], [Acetone], [Benzene], [&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;1_3_Butadi&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]&amp;nbsp; ):&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; message = &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;''&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; int( [Benzene] ) &amp;gt; &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;79&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;bol&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;clr red = '255'&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"Benzene:"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + [Benzene] + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;/clr&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;/bol&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+ &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; el&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; int( [Benzene] ) &amp;gt; &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;:&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;"&amp;lt;bol&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;"&amp;lt;clr green = '255'&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;"Benzene:"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; + [Benzene] + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;"&amp;lt;/clr&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;"&amp;lt;/bol&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;+ &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; int( [Acetone] ) &amp;gt; &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;bol&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;clr green = '255'&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"Acetone:"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + [Acetone] + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;/clr&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;/bol&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; int( [&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;1_3_Butadi&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]&amp;nbsp; ) &amp;gt; &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;bol&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;clr green = '255'&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"1,3-Butadiene:"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + [&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;1_3_Butadi&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]&amp;nbsp; + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;/clr&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;lt;/bol&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+ &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = message + &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; message &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="background-color: inherit; color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:16:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155920#M12012</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T08:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python Labeling Help?</title>
      <link>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155921#M12013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same question.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you give me an example of how this is executed in the Python script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks as if your function is returning the message, but how exactly is that put into the feature class or shapefile you are trying to label?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 00:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155921#M12013</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2015-12-30T00:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python Labeling Help?</title>
      <link>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155922#M12014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean, how to &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s800000027000000"&gt;build a label expression&lt;/A&gt;​, or something different?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 00:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155922#M12014</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-12-30T00:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Python Labeling Help?</title>
      <link>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155923#M12015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren, &lt;/P&gt;&lt;P&gt;Yeah, that's it!&amp;nbsp; Here is a sample of the script: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice, the expression is in VBscript.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="temp.png" class="image-1 jive-image" height="152" src="https://community.esri.com/legacyfs/online/162435_temp.png" style="height: 152px; width: 673.143px;" width="673" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't tried running this yet... but I'm 99% sure it's not going to work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I'm trying to do is label one feature class with stack text as noted above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please excuse my sloppy code, and please let me know if I need to post this as a separate post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 00:37:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155923#M12015</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2015-12-30T00:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python Labeling Help?</title>
      <link>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155924#M12016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My friends, here are some ideas on how to take advantage of Python's very handy string abilities...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def report(clr, lbl, val):
&amp;nbsp; return "&amp;lt;bol&amp;gt;&amp;lt;clr {} = '255'&amp;gt;{}: {}&amp;lt;/clr&amp;gt;&amp;lt;/bol&amp;gt;\n".format(
&amp;nbsp;&amp;nbsp;&amp;nbsp; clr, lbl, val)
def FindLabel([NAME], [Acetone], [Benzene], [1_3_Butadi]):
&amp;nbsp; message = ""
&amp;nbsp; if int([Benzene]) &amp;gt; 79:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message += report("red", "Benzene", [Benzene])
&amp;nbsp; elif int([Benzene]) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message += report("green", "Benzene", [Benzene]) 
&amp;nbsp; if [Acetone] &amp;gt; 0:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message += report("green", "Acetone", [Acetone])
&amp;nbsp; if int([1_3_Butadi]) &amp;gt; 0:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; message += report("green", "1,3-Butadiene", [1_3_Butadi])
&amp;nbsp; return message &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(If you start a table, dataset, or field name with a number, you may regret it. &lt;EM&gt;You have been warned.&lt;/EM&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-labeling-help/m-p/155924#M12016</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T08:17:00Z</dc:date>
    </item>
  </channel>
</rss>

