<?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 lower string? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122658#M9529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is for the model ok:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1414051517638591 jive_text_macro" jivemacro_uid="_1414051517638591" modifiedtitle="true"&gt;
&lt;P&gt;"U:\\rips\\images\\tk50\\" + !BLATT_NR!.lower() + "co*.*"&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result export to python:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140516553516295" jivemacro_uid="_14140516553516295"&gt;
&lt;P&gt;# Process: Feld berechnen&lt;/P&gt;
&lt;P&gt;arcpy.CalculateField_management(Orthos_Nummern_Layer, "Pfad", "\"U:\\\\rips\\\\images\\\\tk50\\\\\" &lt;/P&gt;
&lt;P&gt;+ !BLATT_NR!.lower() + \"co*.* \"", "PYTHON", "")&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No field calculate?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried this:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140517247779683" jivemacro_uid="_14140517247779683"&gt;
&lt;P&gt;arcpy.CalculateField_management(Orthos_Nummern_Layer, "Pfad", "\"U:\\rips\\images\\tk50\\\" &lt;/P&gt;
&lt;P&gt;+ !BLATT_NR!.lower() + \"co*.* \"", "PYTHON", "")&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No field calculate?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Oct 2014 08:09:34 GMT</pubDate>
    <dc:creator>JohannesBierer</dc:creator>
    <dc:date>2014-10-23T08:09:34Z</dc:date>
    <item>
      <title>Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122649#M9520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After insert lower() there's nothing written in the field? What's wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14139801572286858" jivemacro_uid="_14139801572286858"&gt;
&lt;P&gt;# Process: Feld berechnen&lt;/P&gt;
&lt;P&gt;arcpy.CalculateField_management(FeldHinzugefuegt, "Pfad", "\"U:\\rips\\images\\tk50\\tk\" &amp;amp; ([BLATT_NR].lower()) &amp;amp; \"co\" &amp;amp; \"*.*\"", "VB", "")&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 12:16:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122649#M9520</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-10-22T12:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122650#M9521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd put the calculation expression in a variable and check that. It kind of looks like your quotation marks are off, but honestly it's a bit hard to follow all that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 12:47:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122650#M9521</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2014-10-22T12:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122651#M9522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answer. The field calculation work without lower() function, so don't care about all the funny text around.&lt;/P&gt;&lt;P&gt;This must be the problem. Or can`t you lower the expression of a field string in this manner?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 13:08:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122651#M9522</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-10-22T13:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122652#M9523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't believe ".lower()" can be used with the VB parser.&amp;nbsp; That is Python.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 13:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122652#M9523</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-10-22T13:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122653#M9524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="string"&gt;Untested:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Likely what will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14139861570716735 jive_text_macro" jivemacro_uid="_14139861570716735"&gt;
&lt;P&gt;&lt;SPAN class="string"&gt;arcpy.CalculateField_management(FeldHinzugefuegt, &lt;SPAN class="string"&gt;"Pfad", &lt;SPAN class="string"&gt;r"U:\rips\images\tk50\tk\\" + ([BLATT_NR].lower()) + "co\\" + "*.*"&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;"PYTHON_9.3"&lt;/SPAN&gt;, "")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="string"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="string"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;Or from your original code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14139860072742084 jive_text_macro" jivemacro_uid="_14139860072742084"&gt;&lt;SPAN class="string"&gt;arcpy.CalculateField_management(FeldHinzugefuegt, &lt;SPAN class="string"&gt;"Pfad", &lt;SPAN class="string"&gt;"\"U:\\rips\\images\\tk50\\tk\" + ([BLATT_NR].lower()) + \"co\" + \"*.*\""&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;"PYTHON_9.3"&lt;/SPAN&gt;, "")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 13:53:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122653#M9524</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-10-22T13:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122654#M9525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do it manually first then copy the syntax from the field calculator expression, fields in python are enclosed in ! ! marks, if that makes a difference&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 14:48:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122654#M9525</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-10-22T14:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122655#M9526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The VBScript function is &lt;A href="http://www.w3schools.com/vbscript/func_lcase.asp"&gt;LCase&lt;/A&gt;, as in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140325667174661" jivemacro_uid="_14140325667174661"&gt;
&lt;P&gt;LCase("STRING")&lt;/P&gt;





&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really like splitting long Python statements on multiple lines;&amp;nbsp; the interpreter ignores the newline if you are inside ( &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140333888053254" jivemacro_uid="_14140333888053254" modifiedtitle="true"&gt;
&lt;P&gt;# VB Parser&lt;/P&gt;
&lt;P&gt;arcpy.CalculateField_management(FeldHinzugefuegt, "Pfad",&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ("\"U:\\rips\\images\\tk50\\tk\" &amp;amp; LCASE([BLATT_NR])"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;amp; \"co\" &amp;amp;&amp;nbsp; \"*.*\"", &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "VB")'&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Python Parser (better, and will run in arcpy 64)!&lt;/P&gt;
&lt;P&gt;arcpy.CalculateField_management(FeldHinzugefuegt, "Pfad",&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ("\"U:\\rips\\images\\tk50\\tk" &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "{}\\co\\*.*\".format(!BLATT_NR!).lower()"),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "PYTHON")&lt;/P&gt;




&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 02:50:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122655#M9526</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-10-23T02:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122656#M9527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answers, but I can't follow them or they don't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try now to get a model to work and then export to python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140493528421939" jivemacro_uid="_14140493528421939"&gt;
&lt;P&gt;!BLATT_NR!.lower()&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;This works in the model&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140493700636025" jivemacro_uid="_14140493700636025" modifiedtitle="true"&gt;
&lt;P&gt;"U:\\rips\\images\\tk50\\" &amp;amp; !BLATT_NR!.lower() &amp;amp; "co.*"&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;For this I get a error message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 000539: Error running expression: "U:\\rips\\images\\tk50\\" &amp;amp; "L6518".lower() &amp;amp; "co.*" &lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "&amp;lt;expression&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;TypeError: unsupported operand type(s) for &amp;amp;: 'str' and 'str'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 07:32:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122656#M9527</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-10-23T07:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122657#M9528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I need:&lt;/P&gt;&lt;P&gt;"U:\\rips\\images\\tk50\\l6518co.*"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 07:34:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122657#M9528</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-10-23T07:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122658#M9529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is for the model ok:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1414051517638591 jive_text_macro" jivemacro_uid="_1414051517638591" modifiedtitle="true"&gt;
&lt;P&gt;"U:\\rips\\images\\tk50\\" + !BLATT_NR!.lower() + "co*.*"&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result export to python:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140516553516295" jivemacro_uid="_14140516553516295"&gt;
&lt;P&gt;# Process: Feld berechnen&lt;/P&gt;
&lt;P&gt;arcpy.CalculateField_management(Orthos_Nummern_Layer, "Pfad", "\"U:\\\\rips\\\\images\\\\tk50\\\\\" &lt;/P&gt;
&lt;P&gt;+ !BLATT_NR!.lower() + \"co*.* \"", "PYTHON", "")&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No field calculate?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried this:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140517247779683" jivemacro_uid="_14140517247779683"&gt;
&lt;P&gt;arcpy.CalculateField_management(Orthos_Nummern_Layer, "Pfad", "\"U:\\rips\\images\\tk50\\\" &lt;/P&gt;
&lt;P&gt;+ !BLATT_NR!.lower() + \"co*.* \"", "PYTHON", "")&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No field calculate?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 08:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122658#M9529</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-10-23T08:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122659#M9530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Python is to strange for me.&lt;/P&gt;&lt;P&gt;VB goes through - thanks Curtis ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 09:55:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122659#M9530</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-10-23T09:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python lower string?</title>
      <link>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122660#M9531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your string is pretty complicated. You have it working in VB, great. If you decide you need to make it work in Python, I suggest dinking around at the Python command prompt. Turns out I did it wrong, see my trial and error here. I fixed the string in my post above - so nice you can edit your posts here!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14140956199232862" jivemacro_uid="_14140956199232862" modifiedtitle="true"&gt;
&lt;P&gt;# what I originally posted, wrong &lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; "\'U:\\rips\\images\\tk50\\tk\'" "\'{}\\co\\*.*\'.format(!BLATT_NR!).lower()"&lt;/P&gt;
&lt;P&gt;"'U:\\rips\\images\\tk50\\tk''{}\\co\\*.*'.format(!BLATT_NR!).lower()"&lt;/P&gt;
&lt;P&gt;# try again&lt;/P&gt;
&lt;P&gt;# Note the python must evaluate to a string expression&lt;/P&gt;
&lt;P&gt;# for the CalculateField tool&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; ("\"U:\\rips\\images\\tk50\\tk"&lt;/P&gt;
&lt;P&gt;...&amp;nbsp; "{}\\co\\*.*\".format(!BLATT_NR!).lower()")&lt;/P&gt;
&lt;P&gt;'"U:\\rips\\images\\tk50\\tk{}\\co\\*.*".format(!BLATT_NR!).lower()'&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 20:20:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-lower-string/m-p/122660#M9531</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-10-23T20:20:25Z</dc:date>
    </item>
  </channel>
</rss>

