Automation of Unix-like systems often involves text manipulation. Many programs are configured with textual configuration files. Text is the output format and the input format of many systems.
Because of that, many automation tasks end up centering around text manipulation. While tools like sed, grep, and awk have their place, Python is a powerful tool for sophisticated text manipulation.
6.1 Bytes, Strings, and Unicode
When manipulating text or text-like streams, it is easy to write code that fails in funny ways when encountering a foreign ...