string.Template.substitute()

substitute(mapping, **kwds) Performs the template substitution, returning a new string. mapping is any dictionary-like object with keys that match the placeholders in the template. Alternatively, you can provide keyword arguments, where the keywords are the placeholders. When both mapping and kwds are given and there are duplicates, the placeholders from kwds take precedence.

stringprep.in_table_a1()

stringprep.in_table_a1(code) Determine whether code is in tableA.1 (Unassigned code points in Unicode 3.2).

stringprep.in_table_c11()

stringprep.in_table_c11(code) Determine whether code is in tableC.1.1 (ASCII space characters).

string.printable

string.printable String of ASCII characters which are considered printable. This is a combination of digits, ascii_letters, punctuation, and whitespace.

string.Template.safe_substitute()

safe_substitute(mapping, **kwds) Like substitute(), except that if placeholders are missing from mapping and kwds, instead of raising a KeyError exception, the original placeholder will appear in the resulting string intact. Also, unlike with substitute(), any other appearances of the $ will simply return $ instead of raising ValueError. While other exceptions may still occur, this method is called “safe” because substitutions always tries to return a usable string instead of raising an exce

string.hexdigits

string.hexdigits The string '0123456789abcdefABCDEF'.

string.Template

class string.Template(template) The constructor takes a single argument which is the template string. substitute(mapping, **kwds) Performs the template substitution, returning a new string. mapping is any dictionary-like object with keys that match the placeholders in the template. Alternatively, you can provide keyword arguments, where the keywords are the placeholders. When both mapping and kwds are given and there are duplicates, the placeholders from kwds take precedence. safe_sub

string.punctuation

string.punctuation String of ASCII characters which are considered punctuation characters in the C locale.

string.octdigits

string.octdigits The string '01234567'.

string.Formatter.format()

format(format_string, *args, **kwargs) The primary API method. It takes a format string and an arbitrary set of positional and keyword arguments. It is just a wrapper that calls vformat(). Deprecated since version 3.5: Passing a format string as keyword argument format_string has been deprecated.