<?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 26 or Python 27 under arcgis 9.3.1 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299070#M23152</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Given that you have pywin32 installed you can try this hack:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcgisscripting
except ImportError:
&amp;nbsp;&amp;nbsp;&amp;nbsp; import win32com.client
&amp;nbsp;&amp;nbsp;&amp;nbsp; class arcgisscripting(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @staticmethod
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def create():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return win32com.client.Dispatch('esriGeoprocessing.GpDispatch.1')
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will make decouple the python version from the ArcGIS version. The drawback is that you won't be able to use arcpy or the create(9.3) variations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To iterate a list you do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
feature_classes = gp.ListFeatureClasses()

for fc in iter(feature_classes.Next, None):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:21:28 GMT</pubDate>
    <dc:creator>NiklasNorrthon</dc:creator>
    <dc:date>2021-12-11T14:21:28Z</dc:date>
    <item>
      <title>Python 26 or Python 27 under arcgis 9.3.1</title>
      <link>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299068#M23150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hallo,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;can anyone give me some advices to run python 2.6 or pyton 2.7 under arcgis 9.3.1?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need some functions which are only available under the newer python versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Holm&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Dec 2010 09:45:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299068#M23150</guid>
      <dc:creator>HolmSeifert</dc:creator>
      <dc:date>2010-12-19T09:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python 26 or Python 27 under arcgis 9.3.1</title>
      <link>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299069#M23151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Holm,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The arcgisscripting Python module is hard coded for v2.5; but can be configured to use a 2.6 or 2.7 release (no 3.0).&amp;nbsp; Also, because of the move beyond a simple module (arcgisscripting) to a full site library (ArcPy)--the same is not true with ArcGIS 10. Many compiled dependencies, both Python and Numpy,&amp;nbsp; get broken.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For ArcGIS 9.3 there is some coverage in the current ArcGIS Forums and some meat in the old forums, but best resources for the topic are over on the GIS Stackexchange. Read both of these threads to start:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/2226/can-i-use-python-2-6-with-arcgis-9-3"&gt;http://gis.stackexchange.com/questions/2226/can-i-use-python-2-6-with-arcgis-9-3&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://gis.stackexchange.com/questions/609/will-arcgis-10-support-python-2-7-or-python-3-1"&gt;http://gis.stackexchange.com/questions/609/will-arcgis-10-support-python-2-7-or-python-3-1&lt;/A&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Stuart&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Dec 2010 11:49:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299069#M23151</guid>
      <dc:creator>V_StuartFoote</dc:creator>
      <dc:date>2010-12-19T11:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python 26 or Python 27 under arcgis 9.3.1</title>
      <link>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299070#M23152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Given that you have pywin32 installed you can try this hack:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcgisscripting
except ImportError:
&amp;nbsp;&amp;nbsp;&amp;nbsp; import win32com.client
&amp;nbsp;&amp;nbsp;&amp;nbsp; class arcgisscripting(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @staticmethod
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def create():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return win32com.client.Dispatch('esriGeoprocessing.GpDispatch.1')
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will make decouple the python version from the ArcGIS version. The drawback is that you won't be able to use arcpy or the create(9.3) variations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To iterate a list you do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
feature_classes = gp.ListFeatureClasses()

for fc in iter(feature_classes.Next, None):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:21:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299070#M23152</guid>
      <dc:creator>NiklasNorrthon</dc:creator>
      <dc:date>2021-12-11T14:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python 26 or Python 27 under arcgis 9.3.1</title>
      <link>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299071#M23153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What functions do you need? There may very well be a version of the functionality you need for older versions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 20:54:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-26-or-python-27-under-arcgis-9-3-1/m-p/299071#M23153</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2010-12-20T20:54:13Z</dc:date>
    </item>
  </channel>
</rss>

