From the course: Learning ArcGIS Python Scripting (2018)

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Special string characters

Special string characters - ArcGIS Tutorial

From the course: Learning ArcGIS Python Scripting (2018)

Start my 1-month free trial

Special string characters

- [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…

Contents