
The string Module
|
91
winver
Version number used to form registry keys on Windows
platforms (available only on Windows; see the Python
Library Reference).
The string Module
The string module defines constants and variables for pro-
cessing string objects. See also the section “Strings,” earlier in
this book, for a discussion of the string template substitution
tools
Template and SafeTemplate defined in this module.
Module Functions
As of Python 2.0, most functions in this module are also
available as methods of string objects, and method-based
calls are preferred and are more efficient. See the section
“Strings,” earlier in this book, for more details and a list of all
available string methods not repeated here. Only items
unique to the
string module are listed in this section.
atof(s)
atoi(s [, base])
atol(s [, base])
Severely deprecated string-to-number converters. Use
built-in functions
float(), int(), and long() instead (see
the section “Built-in Functions,” earlier in this book).
capwords(s)
Split the argument into words using split, capitalize
each word using
capitalize, and join the capitalized
words using
join. Replaces runs of whitespace charac-
ters by a single space, and removes leading and trailing
whitespace.