In this video, Jennifer Harrison discusses how to handle special characters in Python. Learn what special characters might cause problems in Python scripts and which ones provide special functionality.
- [Instructor] String manipulation is an important concept…in Python.…Alphanumeric strings are used in Python…to hold file names, directory paths, attribute values,…and many other things,…so it's important to make sure to know how to manage…and manipulate strings.…I'm in the Python idle shell window…to demonstrate how we work with strings in Python.…Strings can be surrounded in single or double quotes,…but they have to match.…I can say print, Roads.shp,…Rivers.shp,…and even though the quotes are different…in the print statement, each one is a pair,…so that works just fine.…
Anything inside the quotes gets treated a literal text,…exactly as it's typed.…Well, almost everything.…There are a few special escape characters…that have special meaning inside the quotes.…The backslash N means new line.…The backslash T represents a Tab.…The backslash by itself cancels out the special meaning…of the character that comes immediately after it.…For example, a backslash can cancel out the special meaning…of a quote,…having it just treat it as a literal quote character.…
- 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.