Chapter 1. Text
The string
class is the most obvious text-processing tool available to Python programmers, but plenty of other tools in the standard library are available to make advanced text manipulation simple.
Older code, written before Python 2.0, uses functions from the string
module, instead of methods of string
objects. There is an equivalent method for each function from the module, and use of the functions is deprecated for new code.
Programs using Python 2.4 or later may use string.Template
as a simple way to parameterize strings beyond the features of the string
or unicode
classes. While not as feature-rich as templates defined by many of the Web frameworks or extension modules available from the Python Package Index, string.Template ...
Get The Python Standard Library by Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.