Back to index

python3.2  3.2.2
Classes | Functions | Variables
string Namespace Reference

Classes

class  _multimap
class  _TemplateMetaclass
class  Template
class  Formatter

Functions

def capwords

Variables

string whitespace = ' \t\n\r\v\f'
string ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
string ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 ascii_letters = ascii_lowercase+ascii_uppercase
string digits = '0123456789'
string hexdigits = 'abcdef'
string octdigits = '01234567'
string punctuation = """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
 printable = digits+ascii_letters+punctuation+whitespace

Detailed Description

A collection of string constants.

Public module variables:

whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a string containing all ASCII decimal digits
hexdigits -- a string containing all ASCII hexadecimal digits
octdigits -- a string containing all ASCII octal digits
punctuation -- a string containing all ASCII punctuation characters
printable -- a string containing all ASCII characters considered printable

Function Documentation

def string.capwords (   s,
  sep = None 
)
capwords(s [,sep]) -> string

Split the argument into words using split, capitalize each
word using capitalize, and join the capitalized words using
join.  If the optional second argument sep is absent or None,
runs of whitespace characters are replaced by a single space
and leading and trailing whitespace are removed, otherwise
sep is used to split and join the words.

Definition at line 33 of file string.py.

00033 
00034 def capwords(s, sep=None):
00035     """capwords(s [,sep]) -> string
00036 
00037     Split the argument into words using split, capitalize each
00038     word using capitalize, and join the capitalized words using
00039     join.  If the optional second argument sep is absent or None,
00040     runs of whitespace characters are replaced by a single space
00041     and leading and trailing whitespace are removed, otherwise
00042     sep is used to split and join the words.
00043 
00044     """
00045     return (sep or ' ').join(x.capitalize() for x in s.split(sep))
00046 

Here is the caller graph for this function:


Variable Documentation

Definition at line 23 of file string.py.

string string.ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'

Definition at line 21 of file string.py.

string string.ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

Definition at line 22 of file string.py.

string string.digits = '0123456789'

Definition at line 24 of file string.py.

Definition at line 25 of file string.py.

string string.octdigits = '01234567'

Definition at line 26 of file string.py.

Definition at line 28 of file string.py.

string string.punctuation = """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""

Definition at line 27 of file string.py.

string string.whitespace = ' \t\n\r\v\f'

Definition at line 20 of file string.py.