From the course: Learning ArcGIS Python Scripting

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Write a script using ArcGIS API

Write a script using ArcGIS API - ArcGIS Pro Tutorial

From the course: Learning ArcGIS Python Scripting

Write a script using ArcGIS API

- [Instructor] Let's write some code to interact a little with a web map. In this example, we'll use a lot of the things we've learned so far, including accessing ArcGIS, API for Python objects and their properties, getting input from the user, and checking values with conditional statements. First, since I'm going to be working with web resources, I need to import the ArcGIS module. I'll also import getpass to help me get the password securely. We saw this earlier in the class. Now, I'll make a variable to hold my username, that just makes it easy to change later on. I'll also add a variable to hold my password, but I'm going to set that equal to getpass so the script will stop and ask me to type it in in a secure way. Now, I'll create the GIS object. You remember the way we do that, we set a object variable, I'm going to call it gis, set it equal to ArcGIS.gis.gis. It looks kind of funny, but that's just how it is. ArcGIS.gis.gis. So the ArcGIS library, the GIS module, and the GIS…

Contents