In this video, Jennifer Harrison explains how to import modules into Python scripts. Learn how to get access to GIS capabilities by importing the ArcPy module.
- [Instructor] The Python scripting language includes…some built-in objects and methods.…And the language is enhanced by adding modules…also called site packages or libraries.…Modules give us additional classes…of objects plus specialized functionality,…like the ability to interact with the…Windows operating system, connect to a database,…or access ArcMap.…Some of the modules most commonly used by GIS professionals…include ArcPy, which gets you to the ArcGIS world,…string, math, and datetime,…which give you access to special methods…for manipulating strings, numbers, and dates,…and os and sys which give you access…to the operating system commands,…like sys dot get windows version and os dot walk…which walks recursively through a folder structure.…
There are many others.…When you have time just do a web search…for Python modules to get an idea how many are out there.…The first thing to do in order to get…to the functionality in a module…is to import that module into the script.…That's done with the import statement all in lower case…
- Writing and running Python scripts in IDLE
- Making scripts flexible with variables
- Commenting scripts
- Manipulating string data
- Object-oriented programming in Python
- Creating loops
- Reading and writing text files
- Capturing input at runtime
- Documenting your scripts
Skill Level Beginner
1. Python for ArcGIS Basics
2. Strings, Numbers, and Variables
Work with numeric values5m 22s
3. Syntax Rules
4. Manipulating Strings
5. Object-Oriented Programming
6. Using Loops
7. Generate Log Files
8. Input at Run Time
9. Help Documents
Documenting a script1m 59s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.