<?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: Same python code works in Arcgis python window, but fails in pyScripter. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167755#M12966</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much you are true,once I provided the extension "gdb" it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks once again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Nov 2014 18:49:22 GMT</pubDate>
    <dc:creator>ChroAhmed</dc:creator>
    <dc:date>2014-11-23T18:49:22Z</dc:date>
    <item>
      <title>Same python code works in Arcgis python window, but fails in pyScripter.</title>
      <link>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167749#M12960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H1&gt;&lt;SPAN style="font-size: 12pt;"&gt;Same python code works in Arcgis python window, but fails in pyScripter.&lt;/SPAN&gt;&lt;/H1&gt;&lt;H1&gt;&lt;SPAN style="font-size: 10pt;"&gt;This code works in the arcgis python window but in PyScripter,it shows a warring message of:&lt;/SPAN&gt;&lt;/H1&gt;&lt;H1&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #e23d39;"&gt;(Exceptions. IO Error: "CandidateStations_Centroid" does not exist)!&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/H1&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;path=("C:/Users/fazeel/Desktop/ExampleCase/LeicesterCity_Leeds")&lt;/P&gt;&lt;P&gt;arcpy.env.workspace=path&lt;/P&gt;&lt;P&gt;fields=arcpy.ListFields("CandidateStations_Centroid")&lt;/P&gt;&lt;P&gt;for fld in fields:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder to know the reason of this warring message, any suggestion please?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 18:36:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167749#M12960</guid>
      <dc:creator>ChroAhmed</dc:creator>
      <dc:date>2014-11-11T18:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Same python code works in Arcgis python window, but fails in pyScripter.</title>
      <link>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167750#M12961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;path = "C:/Users/fazeel/Desktop/ExampleCase/LeicesterCity_Leeds"&amp;nbsp; # non-tuple version&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 18:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167750#M12961</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-11-11T18:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Same python code works in Arcgis python window, but fails in pyScripter.</title>
      <link>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167751#M12962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your response. I tried it, but again it showed the same warning message!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 19:17:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167751#M12962</guid>
      <dc:creator>ChroAhmed</dc:creator>
      <dc:date>2014-11-11T19:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Same python code works in Arcgis python window, but fails in pyScripter.</title>
      <link>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167752#M12963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems the reason this is working is because you have a layer named "CandidateStations_Centroid" in your ArcMap session, so it is recognized in the ListFields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your path is referencing a folder and not a GeoDatabase, so you would need to make sure you are pointing to the actual feature class which I am assuming is a shapefile (CandidateStations_Centroid.shp).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 19:51:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167752#M12963</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2014-11-11T19:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Same python code works in Arcgis python window, but fails in pyScripter.</title>
      <link>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167753#M12964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Putting a single value in (parens) doesn't turn it into a tuple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; path=("C:/Users/fazeel/Desktop/ExampleCase/LeicesterCity_Leeds")&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; type(path)&lt;/P&gt;&lt;P&gt;&amp;lt;class 'str'&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'd need to add a comma to get that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; path=("C:/Users/fazeel/Desktop/ExampleCase/LeicesterCity_Leeds",)&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; type(path)&lt;/P&gt;&lt;P&gt;&amp;lt;class 'tuple'&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 17:45:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167753#M12964</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2014-11-12T17:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Same python code works in Arcgis python window, but fails in pyScripter.</title>
      <link>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167754#M12965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;always missing the comma...which is why I hate tuples&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 19:34:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167754#M12965</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-11-12T19:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Same python code works in Arcgis python window, but fails in pyScripter.</title>
      <link>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167755#M12966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much you are true,once I provided the extension "gdb" it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks once again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Nov 2014 18:49:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/same-python-code-works-in-arcgis-python-window-but/m-p/167755#M12966</guid>
      <dc:creator>ChroAhmed</dc:creator>
      <dc:date>2014-11-23T18:49:22Z</dc:date>
    </item>
  </channel>
</rss>

