Free PDFs are available of the Python Primer for ArcGIS Workbooks. (See the links below). Even though these books reference ArcMap and Python 2.x syntax, the content and scripts are still valid and can be used with the newer ArcGIS Pro and Python 3.x syntax. The major difference between 2.x and 3.x syntax for the scripts are the print statements. The exception is the Mapping Module. Since ArcGIS Pro uses the Project and Map Tab/Map Layout structure, the initial Python scripting for the map module is a little syntactically different. See the How To/Education Python section for more specific details, Jupyter notebooks, videos, and sample code/data.
The files below contain Python 2.x (older) and Python 3.x (more current) syntax. Some files contain the Pro project packages (PPKX) as well as the older ArcMap MXD documents. It is recommended to use the Pro package files and the Python 3.x script files. v3 indicates a Python 3.x syntax Python (py) files.
- Workbook 1 – The Fundamentals
- Ch 1-4 – Demo Scripts, Data, Jupyter Notebooks – Basic Python, Data Types, Simple Geoprocessing Script
- Workbook 2 – The Core Geoprocessing Functionality
- Workbook 3 – Functions, Script Tools, and Script Automation
- Ch 10-12 Demo Script and Data – Python Functions, Python Script Tools, and Script Automation
NOTE: The Chapter 10 Python Script tool for tasseled cap is updated with Python 3.x syntax and a Pro Project Package file is provided. The Chapter 10 simple Python function script has been updated with 3.x syntax. The Chapter 12 Batch File and Task Scheduler scripts and files have been updated to use Python 3.x syntax and Pro. The Chapter 10 Custom Script Tool Clip and Buffer has not been updated. The Python Script tool (Tasseled Cap example) is a better option. Chapter 11 Python Add-in scripts have not been updated for Python 3.x. These two items have no plans to update to Python 3.x.
If you would like to support the work I do, please consider purchasing a Kindle or hard copy version. Thank you!
WB I – The Fundamentals – http://bit.ly/1yH80Zk
WB I – Kindle Version
WB II – The Core Geoprocessing Functionality – http://bit.ly/181Xn9k
WB II – Kindle Version
WB III – Functions, Script Tools, and Script Automation – http://bit.ly/2b1S3rs
WB III – Kindle Version
Follow me on Twitter @urbandalegis to find out the latest changes and more about what I do.