Book Image

Python Essentials

By : Steven F. Lott
Book Image

Python Essentials

By: Steven F. Lott

Overview of this book

Table of Contents (22 chapters)
Python Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary of the standard string libraries


Python's standard library offers a number of modules with additional string processing features.

  • string: The string module contains constants that decompose the ASCII characters into letters, numbers, whitespace, and so on. It contains the full definition of the formatter that is used by the str.format() method. We'll look at this in the next section. It also contains the Template class which defines a string template into which values can be interpolated.

  • re: The regular expression library allows us to define a pattern that can be used to parse input strings. We'll look at this in the next section.

  • difflib: The difflib module is used to compare sequences of strings, typically from text files. There are a number of comparison algorithms available in this module.

  • textwrap: We can use the textwrap module to format large blocks of text.

  • unicodedata: The unicodedata module provides functions for determining what kind of Unicode character is present...