<?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: Proper syntac to write string to config.py in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/proper-syntac-to-write-string-to-config-py/m-p/647011#M50409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you - exactly what I needed!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Apr 2013 15:17:28 GMT</pubDate>
    <dc:creator>SuzanneRoulston-Doty</dc:creator>
    <dc:date>2013-04-19T15:17:28Z</dc:date>
    <item>
      <title>Proper syntac to write string to config.py</title>
      <link>https://community.esri.com/t5/python-questions/proper-syntac-to-write-string-to-config-py/m-p/647009#M50407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to write variable values to a config.py file so that I access the values from other scripts.&amp;nbsp; I am having problems properly saving an SQL query statement to the config.py file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sample of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sqlSel = arcpy.GetParameterAsText(1) (e.g. sqlSel will have the value "CNTYNAME" = 'ALACHUA'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fo.write("sqlSel = \"" + sqlSel + '''\"''' + "\n") (I have tried variations of this syntax with no luck -&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fo.write("sqlSel&amp;nbsp; = \"??? + sqlSel + "\???\n")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is written to the config.py file;&amp;nbsp; [ATTACH=CONFIG]23615[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sqlSel = ""CNTYNAME" = 'ALACHUA'" (CNTYNAME is not green indicating it is part of the string value)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 19:18:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/proper-syntac-to-write-string-to-config-py/m-p/647009#M50407</guid>
      <dc:creator>SuzanneRoulston-Doty</dc:creator>
      <dc:date>2013-04-18T19:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proper syntax to write string to config.py</title>
      <link>https://community.esri.com/t5/python-questions/proper-syntac-to-write-string-to-config-py/m-p/647010#M50408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is where the repr() function comes in very handy:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;sqlSel = arcpy.GetParameterAsText(1) fo.write("sqlSel = {0}\n".format(repr(sqlSel)))&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 03:43:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/proper-syntac-to-write-string-to-config-py/m-p/647010#M50408</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-04-19T03:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proper syntac to write string to config.py</title>
      <link>https://community.esri.com/t5/python-questions/proper-syntac-to-write-string-to-config-py/m-p/647011#M50409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you - exactly what I needed!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 15:17:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/proper-syntac-to-write-string-to-config-py/m-p/647011#M50409</guid>
      <dc:creator>SuzanneRoulston-Doty</dc:creator>
      <dc:date>2013-04-19T15:17:28Z</dc:date>
    </item>
  </channel>
</rss>

