<?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 syntaxError: EOL while scanning string literal in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/syntaxerror-eol-while-scanning-string-literal/m-p/1141495#M63675</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am trying to make a new filter with makeFeatureLayer_management . it works fine in arcgis pro as standalone script but while running as a geoprocessing service it shows me an error :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;I&gt;esriJobMessageTypeError&lt;/I&gt;: File "&amp;lt;string&amp;gt;", line 31 arcpy.MakeFeatureLayer_management(CADSrs, CADlyr,g_ESRI_variable_3'") ^ SyntaxError: EOL while scanning string literal&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;the code snippet :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.MakeFeatureLayer_management(CADSrs, CADlyr,"\"Layer\" = 'karar'")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;My question is there any different way to make this filter with python&amp;nbsp;"\"Layer\" = 'karar'"?&lt;/P&gt;&lt;P&gt;I've tried to add r before But it didn't works for me.&lt;/P&gt;&lt;P&gt;Thanks In advance&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2022 06:18:10 GMT</pubDate>
    <dc:creator>abdullahAli91</dc:creator>
    <dc:date>2022-02-08T06:18:10Z</dc:date>
    <item>
      <title>syntaxError: EOL while scanning string literal</title>
      <link>https://community.esri.com/t5/python-questions/syntaxerror-eol-while-scanning-string-literal/m-p/1141495#M63675</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am trying to make a new filter with makeFeatureLayer_management . it works fine in arcgis pro as standalone script but while running as a geoprocessing service it shows me an error :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;I&gt;esriJobMessageTypeError&lt;/I&gt;: File "&amp;lt;string&amp;gt;", line 31 arcpy.MakeFeatureLayer_management(CADSrs, CADlyr,g_ESRI_variable_3'") ^ SyntaxError: EOL while scanning string literal&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;the code snippet :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.MakeFeatureLayer_management(CADSrs, CADlyr,"\"Layer\" = 'karar'")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;My question is there any different way to make this filter with python&amp;nbsp;"\"Layer\" = 'karar'"?&lt;/P&gt;&lt;P&gt;I've tried to add r before But it didn't works for me.&lt;/P&gt;&lt;P&gt;Thanks In advance&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 06:18:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/syntaxerror-eol-while-scanning-string-literal/m-p/1141495#M63675</guid>
      <dc:creator>abdullahAli91</dc:creator>
      <dc:date>2022-02-08T06:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: syntaxError: EOL while scanning string literal</title>
      <link>https://community.esri.com/t5/python-questions/syntaxerror-eol-while-scanning-string-literal/m-p/1141503#M63676</link>
      <description>&lt;P&gt;building the whereclause depends on the source of the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try using AddFieldDelimiters&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fc = r"C:\a_path\to\a\file_geodatabase.gdb\featureclass_name"
whereclause = """{} = 'bob'""".format(arcpy.AddFieldDelimiters(fc, 'Name_2'))
whereclause
"Name_2 = 'bob'"&lt;/LI-CODE&gt;&lt;P&gt;the structure depends on the source&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 08:09:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/syntaxerror-eol-while-scanning-string-literal/m-p/1141503#M63676</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-08T08:09:40Z</dc:date>
    </item>
  </channel>
</rss>

