{"id":450012,"date":"2019-03-18T11:13:51","date_gmt":"2019-03-18T18:13:51","guid":{"rendered":"http:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=450012"},"modified":"2022-03-08T15:37:36","modified_gmt":"2022-03-08T23:37:36","slug":"beginners-guide-to-python-in-arcgis-pro-part-3-tutorial","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial","title":{"rendered":"Beginner&#8217;s guide to Python in ArcGIS Pro, Part 3: Tutorial"},"author":8112,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[22781],"tags":[31181,122232,24341,27911],"industry":[],"product":[36561],"class_list":["post-450012","blog","type-blog","status-publish","format-standard","hentry","category-uncategorized","tag-arcpy","tag-learn","tag-python","tag-tutorial","product-arcgis-pro"],"acf":{"short_description":"A quick hands-on tour of the Python window for the non-programmer.","flexible_content":[{"acf_fc_layout":"content","content":"<p>This post is part of a series for ArcGIS Pro users that are interested in Python but do not have programming experience. If you haven\u2019t yet, check out the first two posts: an <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-1-why\/\">introduction<\/a> and an overview of <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-2-how\/\">learning resources<\/a>. This introductory ArcGIS Pro Python tutorial is designed for beginners to get their feet wet with the Python window and geoprocessing functions. I\u2019ll draw attention to some basic concepts to explain what the code is doing, but note that it\u2019s not a comprehensive introduction, and if it\u2019s your first time, you\u2019ll probably have some unanswered question. This is why I recommend you use <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-2-how\/\">other resources<\/a> to get a solid foundation of Python knowledge from experts.<\/p>\n<h1>A brief tour of the Python window<\/h1>\n<p>In this workflow, you\u2019ll learn to run some geoprocessing tools from the Python window. The Python window is one of two environments you\u2019re most likely to use as you start working with Python and Pro (the other is an Integrated Development Environment or IDE, which we\u2019ll explore in a coming post). In the Python window, you can easily run small bits of code and get immediate feedback on a map. This makes it great for experimentation, as well as small workflows like the one we\u2019ll walk through here.<\/p>\n<h2>Protecting schools from rogue zoo animals<\/h2>\n<p>In this very fictional scenario, you\u2019re a GIS analyst for the city of Redlands, California. There\u2019s a bit of a crisis: a group of troublemakers broke into the Redlands Zoo last night and opened several different enclosures. Potentially dangerous animals are now roaming around town.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":450092,"id":450092,"title":"1croc","filename":"1croc.png","filesize":143107,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/1croc","alt":"Crocodile","author":"8112","description":"","caption":"Not a welcome guest at recess. \n(Photo courtesy fvanrenterghem via Flickr under CC BY-SA 2.0)","name":"1croc","status":"inherit","uploaded_to":450012,"date":"2019-03-02 00:17:06","modified":"2019-03-18 18:41:22","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":500,"height":375,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc-150x150.png","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc.png","medium-width":348,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc.png","medium_large-width":500,"medium_large-height":375,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc.png","large-width":500,"large-height":375,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc.png","1536x1536-width":500,"1536x1536-height":375,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc.png","2048x2048-width":500,"2048x2048-height":375,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc.png","card_image-width":500,"card_image-height":375,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/1croc.png","wide_image-width":500,"wide_image-height":375}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/www.flickr.com\/photos\/fvanrenterghem\/2641634391"},{"acf_fc_layout":"content","content":"<p>Local law mandates that any school within 1 kilometer\u00a0of a confirmed zoo animal sighting must go into lockdown\u00a0(in this version of reality, Redlands both has a zoo and is one of the few places in the US forward-thinking enough to use the metric system). You just received some data collected by two fieldworkers, Jimmy and Lola, detailing recent sightings. Since you might receive more datasets as the day goes on, you decide to automate your analysis.<\/p>\n<p>You plan to use two geoprocessing tools for this analysis:\u00a0<b>Buffer<\/b>\u00a0to\u00a0get a visualization of\u00a0a 1-kilometer radius around each field sighting and\u00a0<b>Select Layer\u00a0<\/b><b>By<\/b><b>\u00a0Location<\/b>\u00a0to identify schools that intersect the buffer zones. You\u2019ll apply these tools to multiple feature classes in the Python window.<\/p>\n<ol>\n<li>Begin by downloading the project package. From the ArcGIS Pro start page, under your list of recent projects, choose Open another project. On the Open Project dialog box, under Portal, click ArcGIS Online. Then, search for \u201cZoo Escape Python Tutorial.\u201d<\/li>\n<\/ol>\n"},{"acf_fc_layout":"image","image":{"ID":1504492,"id":1504492,"title":"zoo-escape-python-tutorial","filename":"zoo-escape-python-tutorial.png","filesize":12807,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/zoo-escape-python-tutorial","alt":"Open Project","author":"5571","description":"","caption":"","name":"zoo-escape-python-tutorial","status":"inherit","uploaded_to":450012,"date":"2022-03-08 23:05:24","modified":"2022-03-08 23:05:39","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":864,"height":231,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial.png","medium-width":464,"medium-height":124,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial.png","medium_large-width":768,"medium_large-height":205,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial.png","large-width":864,"large-height":231,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial.png","1536x1536-width":864,"1536x1536-height":231,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial.png","2048x2048-width":864,"2048x2048-height":231,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial-826x221.png","card_image-width":826,"card_image-height":221,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/zoo-escape-python-tutorial.png","wide_image-width":864,"wide_image-height":231}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<ol start=\"2\">\n<li>Double click the resulting package. If multiple results appear, choose the package with ArcGISProTutorials as the owner.<\/li>\n<\/ol>\n"},{"acf_fc_layout":"image","image":{"ID":450112,"id":450112,"title":"3map","filename":"3map.png","filesize":162199,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/3map","alt":"Starting map of schools and sightings","author":"8112","description":"","caption":"","name":"3map","status":"inherit","uploaded_to":450012,"date":"2019-03-02 00:23:30","modified":"2019-03-02 00:23:50","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":602,"height":351,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map-150x150.png","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map.png","medium-width":448,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map.png","medium_large-width":602,"medium_large-height":351,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map.png","large-width":602,"large-height":351,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map.png","1536x1536-width":602,"1536x1536-height":351,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map.png","2048x2048-width":602,"2048x2048-height":351,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map.png","card_image-width":602,"card_image-height":351,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/3map.png","wide_image-width":602,"wide_image-height":351}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"sidebar","content":"<p>Note: if you&#8217;re unable to locate the project by searching the portal, <a href=\"https:\/\/www.arcgis.com\/home\/item.html?id=4bc1a7c9a74f41c29ac61cf8d7c5e0f4\">go here<\/a>. On the item page, click download. Then, you can open the package from your computer.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 90px;\">When the project opens, you\u2019ll see a map containing\u00a0three point\u00a0feature classes: field sightings from Jimmy, field sightings from Lola, and local schools.<\/p>\n<ol start=\"3\">\n<li>Click the View tab on the ribbon. In the Windows group, click Python. The\u00a0<a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/arcpy\/get-started\/python-window.htm\">Python window<\/a>\u00a0opens. It\u00a0has two components: the\u00a0<strong>transcript<\/strong>\u00a0and the\u00a0<strong>prompt<\/strong>.<\/li>\n<\/ol>\n"},{"acf_fc_layout":"image","image":{"ID":450122,"id":450122,"title":"4pythonwindow","filename":"4pythonwindow.png","filesize":4116,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/4pythonwindow","alt":"Python window","author":"8112","description":"","caption":"When the Python window opens, it will be blank. I added the green comments here for demonstration purposes. In Python, you can add comments to your code by typing # at the start of a line. Python will ignore these lines, and you can use them for your own reference later.  ","name":"4pythonwindow","status":"inherit","uploaded_to":450012,"date":"2019-03-02 00:25:35","modified":"2019-03-07 22:30:49","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":602,"height":178,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow-150x150.png","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow.png","medium-width":464,"medium-height":137,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow.png","medium_large-width":602,"medium_large-height":178,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow.png","large-width":602,"large-height":178,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow.png","1536x1536-width":602,"1536x1536-height":178,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow.png","2048x2048-width":602,"2048x2048-height":178,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow.png","card_image-width":602,"card_image-height":178,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/4pythonwindow.png","wide_image-width":602,"wide_image-height":178}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 90px;\">In order to perform the\u00a0same geoprocessing tasks on\u00a0multiple feature classes, you\u2019ll need to create\u00a0<strong><a class=\"Hyperlink SCXW14743212 BCX5\" href=\"http:\/\/greenteapress.com\/thinkpython2\/html\/thinkpython2011.html\" target=\"_blank\" rel=\"noopener noreferrer\">lists<\/a><\/strong>. The list is one\u00a0of Python&#8217;s common data types. It\u2019s an ordered sequence of items contained in square brackets\u00a0<code>[ ]<\/code>\u00a0and separated by commas. You\u2019ll assign your lists to\u00a0<strong>variables<\/strong>\u2014basically,\u00a0this gives them names that you can call them by.<\/p>\n<ol start=\"4\">\n<li>In the Python window prompt, type the following-<\/li>\n<\/ol>\n<p style=\"padding-left: 90px;\"><code>fcList\u00a0= [\"FieldSightings_Lola\", \"FieldSightings_Jimmy\"]<\/code><\/p>\n<ol start=\"5\">\n<li>Press Enter.<\/li>\n<\/ol>\n<p style=\"padding-left: 90px;\">The line of code moves up into the transcript. There\u2019s not much feedback from assigning this variable. You can check to make sure you created the list successfully by printing it. Type the following and press Enter-<\/p>\n<p style=\"padding-left: 90px;\"><code>print(fcList)<\/code><\/p>\n"},{"acf_fc_layout":"sidebar","content":"<p>Note: It\u2019s important to have your code correct down to the character. If you encounter an error throughout this tutorial, double-check everything you\u2019ve typed up until that point. Python is case sensitive, too.\u00a0If necessary, scroll to the end of the post for more help.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"image","image":{"ID":450212,"id":450212,"title":"5fclist","filename":"5fclist.png","filesize":3012,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/5fclist","alt":"print statement results","author":"8112","description":"","caption":"","name":"5fclist","status":"inherit","uploaded_to":450012,"date":"2019-03-02 00:50:36","modified":"2019-03-02 00:51:00","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":680,"height":200,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist-150x150.png","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist.png","medium-width":464,"medium-height":136,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist.png","medium_large-width":680,"medium_large-height":200,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist.png","large-width":680,"large-height":200,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist.png","1536x1536-width":680,"1536x1536-height":200,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist.png","2048x2048-width":680,"2048x2048-height":200,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist.png","card_image-width":680,"card_image-height":200,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/5fclist.png","wide_image-width":680,"wide_image-height":200}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 90px;\">Next, you\u2019ll create a second, empty list. Lists are\u00a0<strong>mutable<\/strong>, meaning you can add, delete, or modify the items they contain. When you run the Buffer tool in the next step, you\u2019ll use this empty list to store the names of your outputs.<\/p>\n<ol start=\"6\">\n<li>In the prompt, type-<\/li>\n<\/ol>\n<p style=\"padding-left: 90px;\"><code>buffList\u00a0= []<\/code><\/p>\n<p style=\"padding-left: 90px;\">Press Enter. Now you\u2019re ready to buffer your list of feature classes. To do this, you\u2019ll use a\u00a0<a href=\"https:\/\/wiki.python.org\/moin\/ForLoop\"><b>for loop<\/b><\/a>.\u00a0<strong>Loops<\/strong> are a critical part of automating repetitive tasks in Python. The code contained in the loop is repeated over a sequence. In this case, you\u2019ll buffer each item in <code>fcList<\/code>.<\/p>\n<ol start=\"7\">\n<li>Type the following into the prompt (remember the colon at the end!)-<\/li>\n<\/ol>\n<p style=\"padding-left: 90px;\"><code>for\u00a0fc\u00a0in\u00a0fcList:<\/code><\/p>\n<p style=\"padding-left: 90px;\">Press Enter. The line you just typed will stay in the prompt, and your cursor will\u00a0jump down to\u00a0the next line, automatically indented\u00a0(all indented lines under the header are part of the loop). Type:<\/p>\n<p style=\"padding-left: 90px;\"><code>buff\u00a0=\u00a0arcpy.Buffer_analysis(fc,fc+\"_Buffer\",\"1 kilometer\")<\/code><\/p>\n<p style=\"padding-left: 90px;\">arcpy.Buffer_analysis\u00a0is the\u00a0ArcPy\u00a0<b>function\u00a0<\/b>for the Buffer geoprocessing tool (you can find this out by reading the help\u00a0for\u00a0<a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/analysis\/buffer.htm\">Buffer<\/a>). The parameters, which you usually fill out on the Geoprocessing pane, are instead typed inside parentheses. Notice as you type that a screen tip notes the parameter you should specify next.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":450272,"id":450272,"title":"6buffer","filename":"6buffer.png","filesize":12407,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/6buffer","alt":"Screentip for buffer parameters.","author":"8112","description":"","caption":"Here, the next parameter I need to enter is the output feature class, indicated in bold.","name":"6buffer","status":"inherit","uploaded_to":450012,"date":"2019-03-02 00:54:50","modified":"2019-03-02 00:55:26","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":600,"height":90,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer-150x90.png","thumbnail-width":150,"thumbnail-height":90,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer.png","medium-width":464,"medium-height":70,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer.png","medium_large-width":600,"medium_large-height":90,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer.png","large-width":600,"large-height":90,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer.png","1536x1536-width":600,"1536x1536-height":90,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer.png","2048x2048-width":600,"2048x2048-height":90,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer.png","card_image-width":600,"card_image-height":90,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/6buffer.png","wide_image-width":600,"wide_image-height":90}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 90px;\">Let&#8217;s walk through what you have so far (don&#8217;t press Enter yet!).<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":450282,"id":450282,"title":"7buff2","filename":"7buff2.png","filesize":4235,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/7buff2","alt":"Loop buffering feature classes","author":"8112","description":"","caption":"","name":"7buff2","status":"inherit","uploaded_to":450012,"date":"2019-03-02 00:55:59","modified":"2019-03-02 00:56:17","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":600,"height":32,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2-150x32.png","thumbnail-width":150,"thumbnail-height":32,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2.png","medium-width":464,"medium-height":25,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2.png","medium_large-width":600,"medium_large-height":32,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2.png","large-width":600,"large-height":32,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2.png","1536x1536-width":600,"1536x1536-height":32,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2.png","2048x2048-width":600,"2048x2048-height":32,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2.png","card_image-width":600,"card_image-height":32,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/7buff2.png","wide_image-width":600,"wide_image-height":32}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 90px;\"><code>fc<\/code>\u00a0is a new variable, which gets re-assigned to each item in\u00a0<code>fclist<\/code> (i.e., our two\u00a0feature classes\u00a0of animal sightings). It is then used as the input feature class for the Buffer tool.\u00a0<code>fc + \u201c_Buffer\u201d<\/code>\u00a0is the output feature class\u00a0name. This means the resulting feature class will have the same name as the input feature class, plus the suffix\u00a0<code>_Buffer<\/code>,\u00a0for example,\u00a0<code>FieldSightings_Lola_Buffer<\/code>. The\u00a0buffer distance is 1 kilometer.\u00a0You\u00a0use another\u00a0new variable,\u00a0<code>buff<\/code>, to store our output for the next step in the loop, which will add it to\u00a0the empty\u00a0<code>buffList<\/code>.\u00a0You\u2019ll add that step now.<\/p>\n<ol start=\"8\">\n<li>Press Enter again. You\u2019ll still be inside the loop in the prompt. Type-<\/li>\n<\/ol>\n<p style=\"padding-left: 90px;\"><code>buffList.append(buff)<\/code><\/p>\n"},{"acf_fc_layout":"image","image":{"ID":450292,"id":450292,"title":"8append","filename":"8append.png","filesize":4743,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/8append","alt":"Loop with append","author":"8112","description":"","caption":"","name":"8append","status":"inherit","uploaded_to":450012,"date":"2019-03-02 00:59:03","modified":"2019-03-02 00:59:28","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":600,"height":51,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append-150x51.png","thumbnail-width":150,"thumbnail-height":51,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append.png","medium-width":464,"medium-height":39,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append.png","medium_large-width":600,"medium_large-height":51,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append.png","large-width":600,"large-height":51,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append.png","1536x1536-width":600,"1536x1536-height":51,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append.png","2048x2048-width":600,"2048x2048-height":51,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append.png","card_image-width":600,"card_image-height":51,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/8append.png","wide_image-width":600,"wide_image-height":51}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<ol start=\"9\">\n<li>Press Enter twice to\u00a0finish\u00a0the loop and run the code.\u00a0Behind the scenes, Python is running the indented parts of the loop over the two items in\u00a0<code>fcList<\/code>. When it\u2019s done, buffers will appear on the map around all field sightings.<\/li>\n<\/ol>\n"},{"acf_fc_layout":"image","image":{"ID":453082,"id":453082,"title":"9mapbuffered","filename":"9mapbuffered.png","filesize":97710,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/9mapbuffered","alt":"Map with buffers","author":"8112","description":"","caption":"","name":"9mapbuffered","status":"inherit","uploaded_to":450012,"date":"2019-03-07 22:07:01","modified":"2019-03-07 22:07:18","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":398,"height":327,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered-150x150.png","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered.png","medium-width":318,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered.png","medium_large-width":398,"medium_large-height":327,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered.png","large-width":398,"large-height":327,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered.png","1536x1536-width":398,"1536x1536-height":327,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered.png","2048x2048-width":398,"2048x2048-height":327,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered.png","card_image-width":398,"card_image-height":327,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/9mapbuffered.png","wide_image-width":398,"wide_image-height":327}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 90px;\">This visualization gives you a nice overview of the area within a 1-km radius of zoo animal sightings, which you could share with local authorities for reference. You can see that some of the schools are within this area.\u00a0You\u2019ll use another for loop to select them.<\/p>\n<ol start=\"10\">\n<li>Type the following and press\u00a0Enter-<\/li>\n<\/ol>\n<p style=\"padding-left: 90px;\"><code>for buff in\u00a0buffList:<\/code><\/p>\n<p style=\"padding-left: 90px;\">Now, let\u2019s say you\u2019re feeling a bit lazy, and you don\u2019t feel like looking in the Help for the Select Layer by Location tool\u2019s\u00a0ArcPy\u00a0function. Begin to type:<\/p>\n<p style=\"padding-left: 90px;\"><code>arcpy.sel<\/code><\/p>\n<p style=\"padding-left: 90px;\">A screen tip displays a list of\u00a0Arcpy\u00a0functions, including the one you want,\u00a0<code>SelectLayerByLocation_management<\/code>. Click on it.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":453092,"id":453092,"title":"10select","filename":"10select.png","filesize":9388,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/10select","alt":"Autocomplete list of ArcPy functions","author":"8112","description":"","caption":"","name":"10select","status":"inherit","uploaded_to":450012,"date":"2019-03-07 22:09:12","modified":"2019-03-07 22:09:34","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":300,"height":168,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select-150x150.png","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select.png","medium-width":300,"medium-height":168,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select.png","medium_large-width":300,"medium_large-height":168,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select.png","large-width":300,"large-height":168,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select.png","1536x1536-width":300,"1536x1536-height":168,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select.png","2048x2048-width":300,"2048x2048-height":168,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select.png","card_image-width":300,"card_image-height":168,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/10select.png","wide_image-width":300,"wide_image-height":168}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 90px;\">The Python window has other autocomplete options, too.\u00a0Your cursor should now be\u00a0within the parentheses, where you\u2019re prompted to select an input feature class. A list of your current map layers\u00a0has appeared.<\/p>\n<ol start=\"11\">\n<li>Select <code>Schools<\/code>.<\/li>\n<\/ol>\n"},{"acf_fc_layout":"image","image":{"ID":453102,"id":453102,"title":"11schoolslayer","filename":"11schoolslayer.png","filesize":13277,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/11schoolslayer","alt":"Autocomplete list of layers","author":"8112","description":"","caption":"","name":"11schoolslayer","status":"inherit","uploaded_to":450012,"date":"2019-03-07 22:11:03","modified":"2019-03-07 22:11:14","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":422,"height":171,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer-150x150.png","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer.png","medium-width":422,"medium-height":171,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer.png","medium_large-width":422,"medium_large-height":171,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer.png","large-width":422,"large-height":171,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer.png","1536x1536-width":422,"1536x1536-height":171,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer.png","2048x2048-width":422,"2048x2048-height":171,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer.png","card_image-width":422,"card_image-height":171,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/11schoolslayer.png","wide_image-width":422,"wide_image-height":171}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<ol start=\"12\">\n<li>Type a comma.\u00a0This time,\u00a0select <code>WITHIN<\/code> from the list that appears.<\/li>\n<li>Fill in the rest of the parameters as follows-<\/li>\n<\/ol>\n<p style=\"padding-left: 90px;\"><code>arcpy.SelectLayerByLocation_management('Redlands_Schools', 'WITHIN',buff,0,'ADD_TO_SELECTION')<\/code><\/p>\n"},{"acf_fc_layout":"image","image":{"ID":453122,"id":453122,"title":"12buffloop","filename":"12buffloop.png","filesize":2386,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/12buffloop","alt":"Completed loop","author":"8112","description":"","caption":"","name":"12buffloop","status":"inherit","uploaded_to":450012,"date":"2019-03-07 22:15:56","modified":"2019-03-07 22:16:07","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":671,"height":46,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop-150x46.png","thumbnail-width":150,"thumbnail-height":46,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop.png","medium-width":464,"medium-height":32,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop.png","medium_large-width":671,"medium_large-height":46,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop.png","large-width":671,"large-height":46,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop.png","1536x1536-width":671,"1536x1536-height":46,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop.png","2048x2048-width":671,"2048x2048-height":46,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop.png","card_image-width":671,"card_image-height":46,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/12buffloop.png","wide_image-width":671,"wide_image-height":46}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 90px;\">You chose the\u00a0<code>ADD_TO_SELECTION<\/code>\u00a0option because otherwise, the selection from the second feature class would overwrite that of the first. The\u00a0<code>0<\/code>\u00a0for the previous parameter is the search distance. That parameter doesn\u2019t apply in this case, but the\u00a0<code>0<\/code>\u00a0acts\u00a0as a\u00a0placeholder.<\/p>\n<ol start=\"14\">\n<li>Press Enter twice. The six schools close to animal sightings are selected on the map.<\/li>\n<\/ol>\n"},{"acf_fc_layout":"image","image":{"ID":453132,"id":453132,"title":"13selected","filename":"13selected.png","filesize":94456,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\/13selected","alt":"Selected schools","author":"8112","description":"","caption":"","name":"13selected","status":"inherit","uploaded_to":450012,"date":"2019-03-07 22:17:13","modified":"2019-03-07 22:17:25","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":402,"height":310,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected-150x150.png","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected.png","medium-width":338,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected.png","medium_large-width":402,"medium_large-height":310,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected.png","large-width":402,"large-height":310,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected.png","1536x1536-width":402,"1536x1536-height":310,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected.png","2048x2048-width":402,"2048x2048-height":310,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected.png","card_image-width":402,"card_image-height":310,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/03\/13selected.png","wide_image-width":402,"wide_image-height":310}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<ol start=\"15\">\n<li>Save the project.<\/li>\n<\/ol>\n<p style=\"padding-left: 90px;\">You\u2019ve successfully identified schools at high risk from the runaway zoo animals. But your day is far from over, and you&#8217;ll likely need this code again later (the Python window transcript will clear when you close ArcGIS Pro). You&#8217;ll save it as a Python file, which you can load back into the Python window or refine further in another editing environment.<\/p>\n<ol start=\"16\">\n<li>Right-click the transcript and choose Save Transcript. Name the file <em>ZooScript<\/em>, and keep the default .py extension. Save the script to a location that you\u2019ll remember.<\/li>\n<\/ol>\n<p>In the <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-4-tutorial-cont\/\">next post<\/a>, you\u2019ll try running a standalone script in an external environment to continue providing support for the authorities as the zoo crisis continues.<\/p>\n<h3>Got stuck along the way? Check your work against the code snippet below.<\/h3>\n"},{"acf_fc_layout":"sidebar","content":"","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"fcList = [\"FieldSightings_Lola\", \"FieldSightings_Jimmy\"]\r\nprint(fcList)\r\nbuffList = []\r\nfor fc in fcList:\r\n    buff = arcpy.Buffer_analysis(fc,fc+\"_Buffer\",\"1 kilometer\")\r\n    buffList.append(buff)\r\nfor buff in buffList:\r\n    arcpy.SelectLayerByLocation_management('Redlands_Schools', 'WITHIN',buff,0, 'ADD_TO_SELECTION')","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false}],"authors":[{"ID":8112,"user_firstname":"Olivia","user_lastname":"Iannone","nickname":"OIannone","user_nicename":"oiannone","display_name":"Olivia Iannone","user_email":"OIannone@esri.com","user_url":"","user_registered":"2018-06-22 21:48:46","user_description":"I'm a technical writer for ArcGIS Pro who came to Esri after my wildlife biology studies exposed me to the power of GIS. I'm fascinated by how communicating creatively with data connects people to places, and committed to providing ArcGIS Pro users with the information they need to succeed. When I'm not at work, I love to ski, travel, or do anything else that gets me outdoors.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/07\/20190107_165036-213x200.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"related_articles":[{"ID":443452,"post_author":"8112","post_date":"2019-02-26 08:52:12","post_date_gmt":"2019-02-26 16:52:12","post_content":"","post_title":"Beginner's guide to Python in ArcGIS Pro, Part 1: Why?","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"beginners-guide-to-python-in-arcgis-pro-part-1-why","to_ping":"","pinged":"","post_modified":"2019-03-18 11:20:43","post_modified_gmt":"2019-03-18 18:20:43","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=443452","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":447382,"post_author":"8112","post_date":"2019-02-27 09:16:32","post_date_gmt":"2019-02-27 17:16:32","post_content":"","post_title":"Beginner\u2019s guide to Python in ArcGIS Pro, Part 2: How?","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"beginners-guide-to-python-in-arcgis-pro-part-2-how","to_ping":"","pinged":"","post_modified":"2020-06-19 10:56:16","post_modified_gmt":"2020-06-19 17:56:16","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=447382","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":453682,"post_author":"8112","post_date":"2019-03-26 09:46:43","post_date_gmt":"2019-03-26 16:46:43","post_content":"","post_title":"Beginner's guide to Python in ArcGIS Pro, Part 4: Tutorial cont.","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"beginners-guide-to-python-in-arcgis-pro-part-4-tutorial-cont","to_ping":"","pinged":"","post_modified":"2019-07-31 16:30:16","post_modified_gmt":"2019-07-31 23:30:16","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=453682","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"}],"card_image":false,"wide_image":false},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Beginner&#039;s guide to Python in ArcGIS Pro, Part 3: Tutorial<\/title>\n<meta name=\"description\" content=\"Try geoprocessing tools in ArcGIS Pro Python window with this step-by-step introductory tutorial - no prior coding experience required.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Beginner&#039;s guide to Python in ArcGIS Pro, Part 3: Tutorial\" \/>\n<meta property=\"og:description\" content=\"Try geoprocessing tools in ArcGIS Pro Python window with this step-by-step introductory tutorial - no prior coding experience required.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-08T23:37:36+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\"},\"author\":{\"name\":\"Olivia Iannone\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/54fdb9030f5a49100e0c0f41afe93b32\"},\"headline\":\"Beginner&#8217;s guide to Python in ArcGIS Pro, Part 3: Tutorial\",\"datePublished\":\"2019-03-18T18:13:51+00:00\",\"dateModified\":\"2022-03-08T23:37:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\"},\"wordCount\":10,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"ArcPy\",\"Learn\",\"python\",\"Tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\",\"name\":\"Beginner's guide to Python in ArcGIS Pro, Part 3: Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2019-03-18T18:13:51+00:00\",\"dateModified\":\"2022-03-08T23:37:36+00:00\",\"description\":\"Try geoprocessing tools in ArcGIS Pro Python window with this step-by-step introductory tutorial - no prior coding experience required.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Beginner&#8217;s guide to Python in ArcGIS Pro, Part 3: Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/54fdb9030f5a49100e0c0f41afe93b32\",\"name\":\"Olivia Iannone\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/07\/20190107_165036-213x200.jpg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/07\/20190107_165036-213x200.jpg\",\"caption\":\"Olivia Iannone\"},\"description\":\"I'm a technical writer for ArcGIS Pro who came to Esri after my wildlife biology studies exposed me to the power of GIS. I'm fascinated by how communicating creatively with data connects people to places, and committed to providing ArcGIS Pro users with the information they need to succeed. When I'm not at work, I love to ski, travel, or do anything else that gets me outdoors.\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/oiannone\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Beginner's guide to Python in ArcGIS Pro, Part 3: Tutorial","description":"Try geoprocessing tools in ArcGIS Pro Python window with this step-by-step introductory tutorial - no prior coding experience required.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial","og_locale":"en_US","og_type":"article","og_title":"Beginner's guide to Python in ArcGIS Pro, Part 3: Tutorial","og_description":"Try geoprocessing tools in ArcGIS Pro Python window with this step-by-step introductory tutorial - no prior coding experience required.","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2022-03-08T23:37:36+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial"},"author":{"name":"Olivia Iannone","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/54fdb9030f5a49100e0c0f41afe93b32"},"headline":"Beginner&#8217;s guide to Python in ArcGIS Pro, Part 3: Tutorial","datePublished":"2019-03-18T18:13:51+00:00","dateModified":"2022-03-08T23:37:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial"},"wordCount":10,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["ArcPy","Learn","python","Tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial","name":"Beginner's guide to Python in ArcGIS Pro, Part 3: Tutorial","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2019-03-18T18:13:51+00:00","dateModified":"2022-03-08T23:37:36+00:00","description":"Try geoprocessing tools in ArcGIS Pro Python window with this step-by-step introductory tutorial - no prior coding experience required.","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/uncategorized\/beginners-guide-to-python-in-arcgis-pro-part-3-tutorial#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Beginner&#8217;s guide to Python in ArcGIS Pro, Part 3: Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/54fdb9030f5a49100e0c0f41afe93b32","name":"Olivia Iannone","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/07\/20190107_165036-213x200.jpg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/07\/20190107_165036-213x200.jpg","caption":"Olivia Iannone"},"description":"I'm a technical writer for ArcGIS Pro who came to Esri after my wildlife biology studies exposed me to the power of GIS. I'm fascinated by how communicating creatively with data connects people to places, and committed to providing ArcGIS Pro users with the information they need to succeed. When I'm not at work, I love to ski, travel, or do anything else that gets me outdoors.","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/oiannone"}]}},"text_date":"March 18, 2019","author_name":"Olivia Iannone","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/oiannone","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Newsroom-Keyart-Wide-1920-x-1080.jpg","primary_product":"ArcGIS Pro","tag_data":[{"term_id":31181,"name":"ArcPy","slug":"arcpy","term_group":0,"term_taxonomy_id":31181,"taxonomy":"post_tag","description":"","parent":0,"count":32,"filter":"raw"},{"term_id":122232,"name":"Learn","slug":"learn","term_group":0,"term_taxonomy_id":122232,"taxonomy":"post_tag","description":"","parent":0,"count":14,"filter":"raw"},{"term_id":24341,"name":"python","slug":"python","term_group":0,"term_taxonomy_id":24341,"taxonomy":"post_tag","description":"","parent":0,"count":171,"filter":"raw"},{"term_id":27911,"name":"Tutorial","slug":"tutorial","term_group":0,"term_taxonomy_id":27911,"taxonomy":"post_tag","description":"","parent":0,"count":184,"filter":"raw"}],"category_data":[{"term_id":22781,"name":"Uncategorized","slug":"uncategorized","term_group":0,"term_taxonomy_id":22781,"taxonomy":"category","description":"","parent":0,"count":15,"filter":"raw"}],"product_data":[{"term_id":36561,"name":"ArcGIS Pro","slug":"arcgis-pro","term_group":0,"term_taxonomy_id":36561,"taxonomy":"product","description":"","parent":0,"count":2046,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=arcgis-pro","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/450012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/8112"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=450012"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/450012\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=450012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=450012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=450012"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=450012"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=450012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}