<?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: import arcgisscripting and import win32com.client in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/import-arcgisscripting-and-import-win32com-client/m-p/538721#M42113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dan is right but I think I'll add more detail for the record, since I have never seen all of this information in one place:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ArcGIS 9.0, 9.1 - PythonWin/GpDispatch&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="http://sourceforge.net/projects/pywin32/" rel="nofollow noopener noreferrer" target="_blank"&gt;PythonWin's&lt;/A&gt;&lt;SPAN&gt; win32com module was used to access the geoprocessor through a "GpDispatch" COM object. &lt;/SPAN&gt;&lt;A href="http://sourceforge.net/projects/pywin32/" rel="nofollow noopener noreferrer" target="_blank"&gt;PythonWin&lt;/A&gt;&lt;SPAN&gt; was a required install for ArcGIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import win32com
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") 
gp.workspace = "C:/work"
gp.Clip_management(...)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ArcGIS 9.2, 9.3 - arcgisscripting&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;A "native" Python geoprocessing module (arcgisscripting) was introduced. This was faster and more robust, and had the benefit of also being OS-independent, so ArcGIS Server applications on Unix could use Python. PythonWin became an optional install because it was not needed anymore. However, many folks still install PythonWin because of its nice IDE, which is much better than the the default (platform-independent) IDLE. PythonWin also offers many nice Windows-specific interfaces that Windows-centric developers can use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting
gp = arcgisscripting.create(9.3) # specify version for forward compatibility
gp.workspace = "C:/work"
gp.Clip_management(...)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The 9.2, 9.3 and 10.0 versions of arcgisscripting are slightly different. The differences I have run into are a) how cursors work, and b) the format of results from geoprocessor "list" methods (like &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;gp.ListFeatureClasses&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ArcGIS 10.0 - ArcPy&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The ArcPy site package was introduced at 10.0. Most of it is built on top of the arcgisscripting module; it offers lots of advantages for the script developer over the 9.x "gp" way of doing things, largely because it is more Pythonesque, especially in the way toolboxes and tools are accessed. The way ArcPy is set up allows IDE's to use intellisense (options pop up while typing code in an IDE). ArcPy also supports improved access to Spatial Analyst tools through "Python Map Algebra."&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.env.workspace = "C:/work"
arcpy.management.Clip(...)
# Python map algebra
from arcpy.sa import *
maskRaster = Con(Raster("grid1") &amp;gt; 0, 1)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You asked for some reference material. I believe these two articles cover it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS 9.3 help: Creating the geoprocessor object&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Creating_the_geoprocessor_object" rel="nofollow noopener noreferrer" target="_blank"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Creating_the_geoprocessor_object&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS 10 Help: What is ArcPy?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000v7000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000v7000000&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're using ArcGIS 10 and don't have a need to write scripts that support earlier versions, arcpy is &lt;/SPAN&gt;&lt;STRONG&gt;definitely&lt;/STRONG&gt;&lt;SPAN&gt; the way to do it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 23:22:37 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-12-11T23:22:37Z</dc:date>
    <item>
      <title>import arcgisscripting and import win32com.client</title>
      <link>https://community.esri.com/t5/python-questions/import-arcgisscripting-and-import-win32com-client/m-p/538719#M42111</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 a beginner to Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to ask what the difference is between "import arcgisscripting" and " import win32com.client".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, please kindly advise any related references.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Apr 2012 08:09:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-arcgisscripting-and-import-win32com-client/m-p/538719#M42111</guid>
      <dc:creator>ElaineKuo</dc:creator>
      <dc:date>2012-04-29T08:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: import arcgisscripting and import win32com.client</title>
      <link>https://community.esri.com/t5/python-questions/import-arcgisscripting-and-import-win32com-client/m-p/538720#M42112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;import arcpy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcmap 10 and above&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcgisscripting&amp;nbsp; arcmap 9.3 but can be used in 10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import win32com.client&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; older versions of arcmap&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Apr 2012 10:12:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-arcgisscripting-and-import-win32com-client/m-p/538720#M42112</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2012-04-29T10:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: import arcgisscripting and import win32com.client</title>
      <link>https://community.esri.com/t5/python-questions/import-arcgisscripting-and-import-win32com-client/m-p/538721#M42113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dan is right but I think I'll add more detail for the record, since I have never seen all of this information in one place:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ArcGIS 9.0, 9.1 - PythonWin/GpDispatch&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="http://sourceforge.net/projects/pywin32/" rel="nofollow noopener noreferrer" target="_blank"&gt;PythonWin's&lt;/A&gt;&lt;SPAN&gt; win32com module was used to access the geoprocessor through a "GpDispatch" COM object. &lt;/SPAN&gt;&lt;A href="http://sourceforge.net/projects/pywin32/" rel="nofollow noopener noreferrer" target="_blank"&gt;PythonWin&lt;/A&gt;&lt;SPAN&gt; was a required install for ArcGIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import win32com
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") 
gp.workspace = "C:/work"
gp.Clip_management(...)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ArcGIS 9.2, 9.3 - arcgisscripting&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;A "native" Python geoprocessing module (arcgisscripting) was introduced. This was faster and more robust, and had the benefit of also being OS-independent, so ArcGIS Server applications on Unix could use Python. PythonWin became an optional install because it was not needed anymore. However, many folks still install PythonWin because of its nice IDE, which is much better than the the default (platform-independent) IDLE. PythonWin also offers many nice Windows-specific interfaces that Windows-centric developers can use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting
gp = arcgisscripting.create(9.3) # specify version for forward compatibility
gp.workspace = "C:/work"
gp.Clip_management(...)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The 9.2, 9.3 and 10.0 versions of arcgisscripting are slightly different. The differences I have run into are a) how cursors work, and b) the format of results from geoprocessor "list" methods (like &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;gp.ListFeatureClasses&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ArcGIS 10.0 - ArcPy&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The ArcPy site package was introduced at 10.0. Most of it is built on top of the arcgisscripting module; it offers lots of advantages for the script developer over the 9.x "gp" way of doing things, largely because it is more Pythonesque, especially in the way toolboxes and tools are accessed. The way ArcPy is set up allows IDE's to use intellisense (options pop up while typing code in an IDE). ArcPy also supports improved access to Spatial Analyst tools through "Python Map Algebra."&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.env.workspace = "C:/work"
arcpy.management.Clip(...)
# Python map algebra
from arcpy.sa import *
maskRaster = Con(Raster("grid1") &amp;gt; 0, 1)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You asked for some reference material. I believe these two articles cover it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS 9.3 help: Creating the geoprocessor object&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Creating_the_geoprocessor_object" rel="nofollow noopener noreferrer" target="_blank"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Creating_the_geoprocessor_object&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS 10 Help: What is ArcPy?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000v7000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000v7000000&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're using ArcGIS 10 and don't have a need to write scripts that support earlier versions, arcpy is &lt;/SPAN&gt;&lt;STRONG&gt;definitely&lt;/STRONG&gt;&lt;SPAN&gt; the way to do it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:22:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-arcgisscripting-and-import-win32com-client/m-p/538721#M42113</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T23:22:37Z</dc:date>
    </item>
  </channel>
</rss>

