<?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 Carriage Returns/New Line in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17990#M1413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the input people. This was definitely a brain stump on my part. My sytax is correct except I used forward slashes instead of back slashes....so it should have been '\n' instead of '/n'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan, thanks for the reference. It was there, that I recognized my problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2011 20:03:07 GMT</pubDate>
    <dc:creator>MikeMacRae</dc:creator>
    <dc:date>2011-05-17T20:03:07Z</dc:date>
    <item>
      <title>Python Carriage Returns/New Line</title>
      <link>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17987#M1410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey everyone. I've been pouring through the internet to try to find an example to use carriage returns in a python script. (i.e. vbnewline from vb)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my script example below I am cycling through the text elements in a series of maps and replacing any of them that contain the text "TITLE BLOCK" with a string composed of variables that read from a look up table. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see I want the first variable to sit on the first line, the second to sit on the second line and so forth.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;textElement.text = firstline + '/n' + secondline + '/n' + thirdlinea + " " + thirdlineb&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the /n new line function, it's supposed to return the next variable to a new line. This is not working for me. I have tried a number of different ways and I either get an error message or all the texts gets placed into the text element box, but it all sits on one line. Does anyone suggest a workaround?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
for textElement in arcpy.mapping.ListLayoutElements(mxd2, "TEXT_ELEMENT"):
if textElement.text == "TITLE BLOCK":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #print row.SITE
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textElement.text = firstline + '/n' + secondline + '/n' + thirdlinea + " " + thirdlineb
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 17:14:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17987#M1410</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2011-05-17T17:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python Carriage Returns/New Line</title>
      <link>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17988#M1411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think you need "\n"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 17:36:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17988#M1411</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-05-17T17:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python Carriage Returns/New Line</title>
      <link>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17989#M1412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.python.org"&gt;www.python.org&lt;/A&gt;&lt;SPAN&gt; has the official documentation, look for "escape characters" within the string section&amp;nbsp; Books by O'Reilly serve as good hardcopy companions to the web documents that exist.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 17:52:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17989#M1412</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-05-17T17:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python Carriage Returns/New Line</title>
      <link>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17990#M1413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the input people. This was definitely a brain stump on my part. My sytax is correct except I used forward slashes instead of back slashes....so it should have been '\n' instead of '/n'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan, thanks for the reference. It was there, that I recognized my problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 20:03:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-carriage-returns-new-line/m-p/17990#M1413</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2011-05-17T20:03:07Z</dc:date>
    </item>
  </channel>
</rss>

