<?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 Scripting for Geoprocessing Workflows (for ArcGIS 10) - Code Will Not Work in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730014#M56618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One more thing...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri technical support said that their sample code is not intended to be executed. What the hell. That is rediculous in my opinion, but they do explain the full code in the exercise.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Feb 2012 23:59:45 GMT</pubDate>
    <dc:creator>BrittanyGale</dc:creator>
    <dc:date>2012-02-08T23:59:45Z</dc:date>
    <item>
      <title>Python Scripting for Geoprocessing Workflows (for ArcGIS 10) - Code Will Not Work</title>
      <link>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730010#M56614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello! I am taking the virtual Esri class &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Python Scripting for Geoprocessing Workflows (for ArcGIS 10)&lt;/SPAN&gt;&lt;SPAN&gt; and am having trouble executing some of the sample code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the exact code from the course: fcList = arcpy.ListFeatureClasses("C:/Data/SanJuan.gdb")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the code that I am using: testList = arcpy.ListFeatureClasses("H:\Gale_Intermediate_GIS_Data\Gale_Scratch.gdb")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I execute "print testList", a blank list displays: []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The pathname I am using definitely exists. There are no spaces or special characters. There are 9 feature classes within the geodatabase. Esri Tech Support said that they can only help me if my problem exists within their exercises, not their sample code, which makes little sense to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong?!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 23:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730010#M56614</guid>
      <dc:creator>BrittanyGale</dc:creator>
      <dc:date>2012-02-01T23:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting for Geoprocessing Workflows (for ArcGIS 10) - Code Will Not Work</title>
      <link>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730011#M56615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think it is because you are using back slashes not forward slashes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Back slash is an exit code in Python that is used to insert special characters and other info.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

print "Hello\nWorld"

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would result in output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;World&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rather than:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello\nWorld&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;as you may have expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is because in Python "\n" refers to a new line rather than the backslash character and the letter n.&amp;nbsp; Other examples are "\r" for carriage return and "\t" for tab.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Either change the back slash to forward slash "/" as shown in the code or Double up the back slash e.g. "\\" so you are confirming that backslash is what you wish to use.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730011#M56615</guid>
      <dc:creator>HenryColgate</dc:creator>
      <dc:date>2021-12-12T07:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting for Geoprocessing Workflows (for ArcGIS 10) - Code Will Not Work</title>
      <link>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730012#M56616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try putting a r infront of your path:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; path = r"c:\temp\scratch.gdb"
&amp;gt;&amp;gt;&amp;gt; print path
c:\temp\scratch.gdb
&amp;gt;&amp;gt;&amp;gt; path = "c:\temp\scratch.gdb"
&amp;gt;&amp;gt;&amp;gt; print path
c: emp\scratch.gdb
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:10:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730012#M56616</guid>
      <dc:creator>AndrewChapkowski</dc:creator>
      <dc:date>2021-12-12T07:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting for Geoprocessing Workflows (for ArcGIS 10) - Code Will Not Work</title>
      <link>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730013#M56617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for you help! I hadn't realized that my pathname included single backslashes. I learned how to enter pathnames (r"...",&amp;nbsp; \\, or /), but I just didn't catch my syntax error. I felt so silly when I read your responses. But, unfortunately, when I fixed this syntax error, it did not fix the problem. I called Esri Support again, but was lead to a different type of analyst. She helped me fix the problem, but the resulting solution leads us to beleive that the online course I am taking provides bad or incomplete information. Here is an explanation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri says that I can create a list of feature classes by specifying the geodatabase pathname using the following code: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fcList = arcpy.ListFeatureClasses("C:/Data/SanJuan.gdb")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What they did not mention was that a workspace needs to be set first, and that the list is created using the workspace.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Source: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001n000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001n000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code that ended up working was this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; import arcpy
&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = "Q:\Applications\GIS\BGale\AddToSDE.gdb"
&amp;gt;&amp;gt;&amp;gt; fcList = arcpy.ListFeatureClasses()
&amp;gt;&amp;gt;&amp;gt; print fcList
[u'Grid_DetailedMaps', u'Grid_Original', u'RightOfWays_StreetDisplay', u'RoadMedians', u'CensusZipCodes_Edited_ClippedToCityLimit']
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I am happy that I fixed the problem, but I am unhappy that the online course did not explain this. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have a wonderful day everyone!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730013#M56617</guid>
      <dc:creator>BrittanyGale</dc:creator>
      <dc:date>2021-12-12T07:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting for Geoprocessing Workflows (for ArcGIS 10) - Code Will Not Work</title>
      <link>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730014#M56618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One more thing...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri technical support said that their sample code is not intended to be executed. What the hell. That is rediculous in my opinion, but they do explain the full code in the exercise.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 23:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripting-for-geoprocessing-workflows-for/m-p/730014#M56618</guid>
      <dc:creator>BrittanyGale</dc:creator>
      <dc:date>2012-02-08T23:59:45Z</dc:date>
    </item>
  </channel>
</rss>

