<?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 labels python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/labels-python/m-p/213078#M16408</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use this on a python script that I made:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;def FindLabel ( [FIRST_DENO] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if 'ONF OFFICE NATIONAL DES FORETS' in([FIRST_DENO] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return [FIRST_DENO] .replace('ONF OFFICE NATIONAL DES FORETS', 'ONF')&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; elif 'GROUPEMENT FORESTIER' in([FIRST_DENO] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return [FIRST_DENO] .replace('GROUPEMENT FORESTIER', 'GF')&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; else :&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return [FIRST_DENO]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This actually runs fine In the ArcGis environment (label expression) , but I've been struggling to find the way to do it within the python script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this in python&amp;nbsp;at first :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#&amp;nbsp;labels&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;for out_layer_dissolve in arcpy.mapping.ListLayers(mxd):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if out_layer_dissolve.name == out_table +"\\"+ "dissolve2_"+dept+".lyr":&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; out_layer_dissolve.name = "localisant_tampon_"+ dept + "_" + Buffer + "m"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; out_layer_dissolve.transparency = 60&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; out_layer_dissolve.showLabels = True&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if out_layer_dissolve.supports("LABELCLASSES"):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for label in out_layer_dissolve.labelClasses:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;label.expression = '"{}" + [FIRST_DENO] + "{}"'.format("&amp;lt;CLR red = '0' green = '0' blue = '0'&amp;gt;&amp;lt;FNT size = '5'&amp;gt;","&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I couldn't&amp;nbsp; succeed when I tried to use the function and I had the message that [FIRST_DENO]&amp;nbsp;isn't&amp;nbsp;iterable.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I'm just an amateur in scripting but I feel that this is going to be more complicated than I thought.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I wish someone could help me find the way to do it.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Many thanks&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jul 2019 12:15:25 GMT</pubDate>
    <dc:creator>samsinson</dc:creator>
    <dc:date>2019-07-12T12:15:25Z</dc:date>
    <item>
      <title>labels python</title>
      <link>https://community.esri.com/t5/python-questions/labels-python/m-p/213078#M16408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use this on a python script that I made:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;def FindLabel ( [FIRST_DENO] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if 'ONF OFFICE NATIONAL DES FORETS' in([FIRST_DENO] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return [FIRST_DENO] .replace('ONF OFFICE NATIONAL DES FORETS', 'ONF')&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; elif 'GROUPEMENT FORESTIER' in([FIRST_DENO] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return [FIRST_DENO] .replace('GROUPEMENT FORESTIER', 'GF')&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; else :&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return [FIRST_DENO]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This actually runs fine In the ArcGis environment (label expression) , but I've been struggling to find the way to do it within the python script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this in python&amp;nbsp;at first :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#&amp;nbsp;labels&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;for out_layer_dissolve in arcpy.mapping.ListLayers(mxd):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if out_layer_dissolve.name == out_table +"\\"+ "dissolve2_"+dept+".lyr":&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; out_layer_dissolve.name = "localisant_tampon_"+ dept + "_" + Buffer + "m"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; out_layer_dissolve.transparency = 60&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; out_layer_dissolve.showLabels = True&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if out_layer_dissolve.supports("LABELCLASSES"):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for label in out_layer_dissolve.labelClasses:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;label.expression = '"{}" + [FIRST_DENO] + "{}"'.format("&amp;lt;CLR red = '0' green = '0' blue = '0'&amp;gt;&amp;lt;FNT size = '5'&amp;gt;","&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I couldn't&amp;nbsp; succeed when I tried to use the function and I had the message that [FIRST_DENO]&amp;nbsp;isn't&amp;nbsp;iterable.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I'm just an amateur in scripting but I feel that this is going to be more complicated than I thought.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I wish someone could help me find the way to do it.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Many thanks&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jul 2019 12:15:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/labels-python/m-p/213078#M16408</guid>
      <dc:creator>samsinson</dc:creator>
      <dc:date>2019-07-12T12:15:25Z</dc:date>
    </item>
  </channel>
</rss>

