In this video, Jennifer Harrison discusses how to read and write object properties and call methods. Learn how to modify Python string objects with methods and how to read and change GIS object properties.
- [Instructor] In object oriented programming…you access objects, such as map documents,…which have properties like the author,…and methods, such a save a copy.…Python has some built-in object classes…like numbers and strings, and built-in…functions and methods, like round, which is a method…for a numeric object, and upper, which is a method…for a string object.…When I teach this to new Arc Mac users…I always call these Python functions,…but here I can use the proper terminology.…
These are methods that work on numeric and string objects.…Just to clarify here, a method is a bit of code…that works on an object and does something to the object.…A function, is also a bit of code…that does a particular task.…The difference is that a function has to be passed…some data to work on, with a method…is associated while a particular object.…Additional classes and methods are included…in site packages, also called modules.…Math, string and arcpy are all modules…that can be added to Python scripts.…
For example, if you input the string module…
- 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.