﻿{"id":5259,"date":"2018-05-16T23:09:17","date_gmt":"2018-05-16T21:09:17","guid":{"rendered":"http:\/\/www.sigterritoires.fr\/?p=5259"},"modified":"2018-10-17T12:51:02","modified_gmt":"2018-10-17T10:51:02","slug":"arcgis-and-python-before-starting","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/","title":{"rendered":"ArcGis and Python: before starting"},"content":{"rendered":"<p>Getting started with Python in ArcGIS is easier than it looks.\u00a0There is no need to master Python in order to use it in a basic way in our work with ArcGIS.<br \/>\nFirst of all, there are several options for executing our processes with Python code.\u00a0So we will start by discussing the different options and how to make the right choice for our needs, whether it is simply testing a code line or a piece of script or the complete execution of a script.<\/p>\n<p>The difference between running a code line and executing a script, in terms of programming, is that for the first time we will use an\u00a0\u00a0\u00a0<strong>INTERPRETER<\/strong>\u00a0\u00a0\u00a0and secondly, we will use an\u00a0\u00a0\u00a0<strong>EDITOR<\/strong>.<!--more--><\/p>\n<p>An interpreter will execute the code, order by order, while the editor translates the whole script code into the system&rsquo;s machine code to create an executable file.\u00a0It will be possible to run a program compiled directly into the machine, while the uncompiled code must be executed inside another application with the interpreter.<\/p>\n<p>To see how the different options work we will use a simple example: we have a layer of polygons with the different councils of Finist\u00e8re (France) and we want to obtain a layer of polylines.\u00a0ArcGis geoprocessing tools have a task called, FeatureToLine_management, that executes this operation.<\/p>\n<p><strong>1-How to interpret Pyton <\/strong><\/p>\n<p>There are three ways to use Python through an interpreter:<\/p>\n<ul>\n<li>From Python itself, in command line mode<\/li>\n<li>From the ArcGis Python Console<\/li>\n<li>From the console of another Integrated Development Environment (IDE) such as PyScripter, PythonWin, &#8230;<\/li>\n<\/ul>\n<p><strong>1-A: Python Command Line<\/strong><\/p>\n<p>Without opening ArcGis or any other software, just open a command window (In launching Windows programs,\u00a0\u00a0\u00a0<em>run -&gt; cmd<\/em>\u00a0)<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5261\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/py0-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py0.png?fit=630%2C321&amp;ssl=1\" data-orig-size=\"630,321\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"py0\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py0.png?fit=630%2C321&amp;ssl=1\" class=\"alignnone size-medium wp-image-5261\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py0-300x153.png?resize=300%2C153\" alt=\"\" width=\"300\" height=\"153\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py0.png?resize=300%2C153&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py0.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>You launch Python by simply typing<\/p>\n<p><strong><em>python<\/em><\/strong><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5268\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/py1-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py1.png?fit=630%2C320&amp;ssl=1\" data-orig-size=\"630,320\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"py1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py1.png?fit=630%2C320&amp;ssl=1\" class=\"alignnone size-medium wp-image-5268\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py1-300x152.png?resize=300%2C152\" alt=\"\" width=\"300\" height=\"152\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py1.png?resize=300%2C152&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py1.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>the three arrows (&gt;&gt;&gt;) indicate that you can enter your Python command.<\/p>\n<p>The first command is used to load the functions of ArcGis into Python.\u00a0type<\/p>\n<p><strong><em>arcpy import<\/em><\/strong><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5269\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/py3-4\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py3.png?fit=630%2C316&amp;ssl=1\" data-orig-size=\"630,316\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"py3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py3.png?fit=630%2C316&amp;ssl=1\" class=\"alignnone size-medium wp-image-5269\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py3-300x150.png?resize=300%2C150\" alt=\"\" width=\"300\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py3.png?resize=300%2C150&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/py3.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>That&rsquo;s all it takes to be able to execute our command that will transform our polygons into polylines.\u00a0Then, we enter the order:<\/p>\n<p><strong><em>arcpy.FeatureToLine_management (\u00ab\u00a0<\/em><\/strong>\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>C: \\ ArcGIS \\ com29.shp<\/em><\/strong>\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>\u00bb,\u00ab<\/em><\/strong>\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>C: \\ ArcGIS \\ com29_lignes.shp<\/em><\/strong>\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>\u00ab\u00a0)<\/em><\/strong><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5271\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pydos\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydos.png?fit=630%2C319&amp;ssl=1\" data-orig-size=\"630,319\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pydos\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydos.png?fit=630%2C319&amp;ssl=1\" class=\"alignnone size-medium wp-image-5271\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydos-300x152.png?resize=300%2C152\" alt=\"\" width=\"300\" height=\"152\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydos.png?resize=300%2C152&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydos.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The &lt;Result &#8230; line tells us that the operation was successful and that the new layer was created.<\/p>\n<p>If we open ArcMap and we display this resulting layer we see:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5272\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pytres\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pytres.png?fit=630%2C335&amp;ssl=1\" data-orig-size=\"630,335\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pytres\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pytres.png?fit=630%2C335&amp;ssl=1\" class=\"alignnone size-medium wp-image-5272\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pytres-300x160.png?resize=300%2C160\" alt=\"\" width=\"300\" height=\"160\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pytres.png?resize=300%2C160&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pytres.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Note that we have just done an ArcGis geoprocessing without having opened ArcGis and in a 5 to 10 fold less time than ArcMap takes to start &#8230;<br \/>\nOf course, you need to know the syntax and where the files are.\u00a0Of course it is modest.\u00a0But it&rsquo;s still not as incomprehensible as what you thought it would be.<\/p>\n<p>Now let&rsquo;s go back one step above.<\/p>\n<p><strong>1-B: Run the Command Line in the ArcMap Python Console<\/strong><\/p>\n<p>Open the Python console by clicking on the corresponding key in the ArcMap window<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5273\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pycuatro\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycuatro.png?fit=630%2C221&amp;ssl=1\" data-orig-size=\"630,221\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pycuatro\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycuatro.png?fit=630%2C221&amp;ssl=1\" class=\"alignnone size-medium wp-image-5273\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycuatro-300x105.png?resize=300%2C105\" alt=\"\" width=\"300\" height=\"105\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycuatro.png?resize=300%2C105&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycuatro.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>We enter the command line to import the ArcGis library (import arcpy) and we start entering the second command line<\/p>\n<p><strong><em>arcpy.FeatureToLine_management (\u00ab\u00a0<\/em><\/strong>\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>C: \\ ArcGIS \\ com29.shp<\/em><\/strong>\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>\u00bb,\u00ab<\/em><\/strong>\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>C: \\ ArcGIS \\ com29_lignes.shp<\/em><\/strong>\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>\u00ab\u00a0)<\/em><\/strong><\/p>\n<p>Here, unlike the previous command window, we have an indicative input available.\u00a0When you start typing a function, the list of functions is displayed and you can simply click on the one you are looking for:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5274\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pycinco\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycinco.png?fit=630%2C164&amp;ssl=1\" data-orig-size=\"630,164\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pycinco\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycinco.png?fit=630%2C164&amp;ssl=1\" class=\"alignnone size-medium wp-image-5274\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycinco-300x78.png?resize=300%2C78\" alt=\"\" width=\"300\" height=\"78\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycinco.png?resize=300%2C78&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pycinco.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>When you start entering the parameters of the function, a descriptive help for the parameters is automatically displayed in the right side window:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5275\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyseis\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyseis.png?fit=630%2C151&amp;ssl=1\" data-orig-size=\"630,151\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyseis\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyseis.png?fit=630%2C151&amp;ssl=1\" class=\"alignnone size-medium wp-image-5275\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyseis-300x72.png?resize=300%2C72\" alt=\"\" width=\"300\" height=\"72\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyseis.png?resize=300%2C72&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyseis.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>If you have loaded the corresponding parameters layers \u00a0in ArcMap, you will have the drop-down list of the layers avoiding you to type the whole name.<\/p>\n<p>When executing the command, besides the &lt;Result &#8230; message you will observe that a detailed list of the processes is displayed in the right side window.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5276\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pysiete\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pysiete.png?fit=630%2C150&amp;ssl=1\" data-orig-size=\"630,150\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pysiete\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pysiete.png?fit=630%2C150&amp;ssl=1\" class=\"alignnone size-medium wp-image-5276\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pysiete-300x71.png?resize=300%2C71\" alt=\"\" width=\"300\" height=\"71\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pysiete.png?resize=300%2C71&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pysiete.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>1-C: From the console of another IDE<\/strong><\/p>\n<p>The different integrated development environments are, in principle, intended to perform executables.\u00a0But, of course, they have interpretation consoles equivalent to the ArcMap Python console.<\/p>\n<p>For example,\u00a0<a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=fr&amp;tl=en&amp;u=https:\/\/code.google.com\/p\/pyscripter\/\">\u00a0<\/a>\u00a0<a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=fr&amp;tl=en&amp;u=https:\/\/code.google.com\/p\/pyscripter\/\">PyScripter<\/a>\u00a0, allows you to enter and execute both command lines.\u00a0The difference lies on the type of help for writing orders:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5277\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyocho\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyocho.png?fit=630%2C494&amp;ssl=1\" data-orig-size=\"630,494\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyocho\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyocho.png?fit=630%2C494&amp;ssl=1\" class=\"alignnone size-medium wp-image-5277\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyocho-300x235.png?resize=300%2C235\" alt=\"\" width=\"300\" height=\"235\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyocho.png?resize=300%2C235&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyocho.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Generally you will have more features offered by an IDE than by theArcMap Python console.\u00a0But if you keep using \u00a0the command line both are pretty equivalent.\u00a0The main difference is that the IDE allows you to write, test, and debug complete Python scripts.<\/p>\n<p><strong>2- How to compile and execute Phyton <\/strong><\/p>\n<p>In the three previous examples, we enter the command lines one at a time.\u00a0Each command is interpreted and executed.<br \/>\nBut we can create a file, containing all the commands to execute, and then we can ask an application to compile and execute it.\u00a0This is what we will call a\u00a0\u00a0\u00a0<strong><em>script<\/em><\/strong>.<br \/>\nWe will create a text file, with a .py extension containing our two command lines:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5278\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pynueve\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pynueve.png?fit=630%2C150&amp;ssl=1\" data-orig-size=\"630,150\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pynueve\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pynueve.png?fit=630%2C150&amp;ssl=1\" class=\"alignnone size-medium wp-image-5278\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pynueve-300x71.png?resize=300%2C71\" alt=\"\" width=\"300\" height=\"71\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pynueve.png?resize=300%2C71&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pynueve.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>We will call this example file .py<\/p>\n<p>We have four possibilities to run a Python script:<\/p>\n<ul>\n<li>run it with Python<\/li>\n<li>run it with an IDE<\/li>\n<li>run it as a tool in the ArcGis toolbox<\/li>\n<li>run it as an ArcMap command button<\/li>\n<\/ul>\n<p><strong>2-A: Compile and run with Python<\/strong><\/p>\n<p>If we open a command window we can execute the example.py file directly in Python, simply typing<\/p>\n<p><strong><em>python.exe c: \\ ArcGis \\ example.py<\/em><\/strong><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5279\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pydiez\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydiez.png?fit=630%2C317&amp;ssl=1\" data-orig-size=\"630,317\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pydiez\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydiez.png?fit=630%2C317&amp;ssl=1\" class=\"alignnone size-medium wp-image-5279\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydiez-300x151.png?resize=300%2C151\" alt=\"\" width=\"300\" height=\"151\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydiez.png?resize=300%2C151&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pydiez.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Python compiles and executes the commands.\u00a0No message is displayed on the progress and completion of the functions, but if there were an error we would have had the error messages displayed.<\/p>\n<p>This option is ideal if you want to perform certain tasks from the Windows Task Scheduler.<\/p>\n<p><strong>2-B: Compile and run with an IDE<\/strong><\/p>\n<p>Of course you can run a script from an integrated development environment.<br \/>\nUsually, we execute a Python script from the IDE as we are developing it.\u00a0This makes it possible to use the console to test certain functions, as well as to use step-by-step execution for debugging, tracking variable values \u200b\u200bthroughout the process, and so on.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5280\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyonce\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyonce.png?fit=630%2C335&amp;ssl=1\" data-orig-size=\"630,335\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyonce\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyonce.png?fit=630%2C335&amp;ssl=1\" class=\"alignnone size-medium wp-image-5280\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyonce-300x160.png?resize=300%2C160\" alt=\"\" width=\"300\" height=\"160\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyonce.png?resize=300%2C160&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyonce.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>2-C: Create a tool from the ArcGis toolbox<\/strong><\/p>\n<p>Once you have created and validated the script with your IDE, you have a script file that can be stored and run as a tool in the ArcGis Toolbox.<\/p>\n<p>To do this, right-click on one of your personal toolboxes, select\u00a0\u00a0\u00a0<strong><em>Add -&gt; Script<\/em><\/strong><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5282\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyatilio-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio-1.png?fit=445%2C601&amp;ssl=1\" data-orig-size=\"445,601\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyatilio\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio-1.png?fit=445%2C601&amp;ssl=1\" class=\"alignnone size-medium wp-image-5282\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio-1-222x300.png?resize=222%2C300\" alt=\"\" width=\"222\" height=\"300\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio-1.png?resize=222%2C300&amp;ssl=1 222w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio-1.png?w=445&amp;ssl=1 445w\" sizes=\"auto, (max-width: 222px) 100vw, 222px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The add script window opens:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5283\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyatilio1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio1.png?fit=451%2C563&amp;ssl=1\" data-orig-size=\"451,563\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyatilio1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio1.png?fit=451%2C563&amp;ssl=1\" class=\"alignnone size-medium wp-image-5283\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio1-240x300.png?resize=240%2C300\" alt=\"\" width=\"240\" height=\"300\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio1.png?resize=240%2C300&amp;ssl=1 240w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilio1.png?w=451&amp;ssl=1 451w\" sizes=\"auto, (max-width: 240px) 100vw, 240px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Give a name (without spaces or special characters) and a label (you are free of content).<\/p>\n<p>Click Next to highlight the script file.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5284\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyatiliodos\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliodos.png?fit=452%2C562&amp;ssl=1\" data-orig-size=\"452,562\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyatiliodos\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliodos.png?fit=452%2C562&amp;ssl=1\" class=\"alignnone size-medium wp-image-5284\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliodos-241x300.png?resize=241%2C300\" alt=\"\" width=\"241\" height=\"300\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliodos.png?resize=241%2C300&amp;ssl=1 241w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliodos.png?w=452&amp;ssl=1 452w\" sizes=\"auto, (max-width: 241px) 100vw, 241px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The third window is used to manage the script parameters.\u00a0In our case there are no parameters.<\/p>\n<p>Your script is now available as a tool in your toolbox and can be run in the same way as any other tool.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5285\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyatiliotres\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliotres.png?fit=630%2C441&amp;ssl=1\" data-orig-size=\"630,441\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyatiliotres\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliotres.png?fit=630%2C441&amp;ssl=1\" class=\"alignnone size-medium wp-image-5285\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliotres-300x210.png?resize=300%2C210\" alt=\"\" width=\"300\" height=\"210\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliotres.png?resize=300%2C210&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliotres.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>The window \u00a0\u00bb\u00a0\u00a0\u00a0Results\u00a0\u00a0\u00a0\u00ab\u00a0allows to verify the good execution of the script.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5286\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyatiliocinco\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliocinco.png?fit=386%2C264&amp;ssl=1\" data-orig-size=\"386,264\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyatiliocinco\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliocinco.png?fit=386%2C264&amp;ssl=1\" class=\"alignnone size-medium wp-image-5286\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliocinco-300x205.png?resize=300%2C205\" alt=\"\" width=\"300\" height=\"205\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliocinco.png?resize=300%2C205&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliocinco.png?w=386&amp;ssl=1 386w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>2-D: Create a Button or Toolbar for ArcMap with a Python Addin<\/strong><\/p>\n<p>We will not keep on with the example of creating AddIn Python because it is much more complicated than the previous examples.\u00a0The purpose of creating a button is to be able to interact with the content of ArcMap, with other scripts or tools, to manage forms, etc. Our example is far from what the buttons are supposed to do.<br \/>\nIn any case, the approach is as follows:<br \/>\nYou will use the python addins creation wizard (\u00a0<a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=fr&amp;tl=en&amp;u=http:\/\/www.arcgis.com\/home\/item.html%3Fid%3D5f3aefe77f6b4f61ad3e4c62f30bff3b\">download here<\/a>\u00a0)<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5287\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyatilioseis\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilioseis.png?fit=630%2C562&amp;ssl=1\" data-orig-size=\"630,562\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyatilioseis\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilioseis.png?fit=630%2C562&amp;ssl=1\" class=\"alignnone size-medium wp-image-5287\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilioseis-300x268.png?resize=300%2C268\" alt=\"\" width=\"300\" height=\"268\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilioseis.png?resize=300%2C268&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatilioseis.png?w=630&amp;ssl=1 630w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Once you have completed the definition of the addin, you will create the addin file.<\/p>\n<p>In the working folder, run the makeaddin.py script by double-clicking this script.\u00a0All the files and folders needed by the add-in are copied to a compressed add-in file in the working folder.The file name is composed of the name of the working folder and an extension\u00a0<strong><em>\u00a0<\/em><\/strong>\u00a0<strong><em>.esriaddin.<\/em><\/strong><\/p>\n<p>You still have to install the addin:<\/p>\n<p>Double-click the new add-in file to launch the ESRI ArcGIS Add-In Installation Utility.\u00a0When this utility is retrieved, it analyzes the file\u00a0\u00a0\u00a0<strong><em>config.xml<\/em><\/strong>\u00a0of\u00a0the add-in file, the project settings entered during the creation of the add-in, and whether the add-in contains a reliable digital signature, as shown below.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"5288\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/arcgis-and-python-before-starting\/pyatiliosiete\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliosiete.png?fit=328%2C346&amp;ssl=1\" data-orig-size=\"328,346\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pyatiliosiete\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliosiete.png?fit=328%2C346&amp;ssl=1\" class=\"alignnone size-medium wp-image-5288\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliosiete-284x300.png?resize=284%2C300\" alt=\"\" width=\"284\" height=\"300\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliosiete.png?resize=284%2C300&amp;ssl=1 284w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/05\/pyatiliosiete.png?w=328&amp;ssl=1 328w\" sizes=\"auto, (max-width: 284px) 100vw, 284px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Now you are able to use customization in the ArcGIS for Desktop application.\u00a0Start the desktop application (ArcMap).\u00a0The toolbar or custom menu may already be visible and ready for testing.\u00a0Otherwise, in the menu\u00a0\u00a0\u00a0<em>Customize<\/em>\u00a0, click\u00a0\u00a0\u00a0<em>Add-In Manager<\/em>\u00a0.\u00a0The Add-In Manager dialog lists the installed add-ins that target the current application.\u00a0The add-in information, such as the name, description, and image entered in the project settings, should be displayed.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting started with Python in ArcGIS is easier than it looks.\u00a0There is no need to master Python in order to use it in a basic way in our work with ArcGIS. First of all, there are&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"give_campaign_id":0,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1260],"tags":[],"class_list":["post-5259","post","type-post","status-publish","format-standard","hentry","category-non-classe-en"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-1mP","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/5259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=5259"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/5259\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=5259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=5259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=5259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}