| |
- _float = float(...)
- float(x) -> floating point number
Convert a string or number to a floating point number, if possible.
- _int = int(...)
- int(x[, base]) -> integer
Convert a string or number to an integer, if possible. A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!) When converting a string, use
the optional base. It is an error to supply a base when converting a
non-string.
- _long = long(...)
- long(x) -> long integer
long(x, base) -> long integer
Convert a string or number to a long integer, if possible. A floating
point argument will be truncated towards zero (this does not include a
string representation of a floating point number!) When converting a
string, use the given base. It is an error to supply a base when
converting a non-string.
- atof(s)
- atof(s) -> float
Return the floating point number represented by the string s.
- atoi(s, base=10)
- atoi(s [,base]) -> int
Return the integer represented by the string s in the given
base, which defaults to 10. The string s must consist of one
or more digits, possibly preceded by a sign. If base is 0, it
is chosen from the leading characters of s, 0 for octal, 0x or
0X for hexadecimal. If base is 16, a preceding 0x or 0X is
accepted.
- atol(s, base=10)
- atol(s [,base]) -> long
Return the long integer represented by the string s in the
given base, which defaults to 10. The string s must consist
of one or more digits, possibly preceded by a sign. If base
is 0, it is chosen from the leading characters of s, 0 for
octal, 0x or 0X for hexadecimal. If base is 16, a preceding
0x or 0X is accepted. A trailing L or l is not accepted,
unless base is 0.
- capitalize(s)
- capitalize(s) -> string
Return a copy of the string s with only its first character
capitalized.
- 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. Note that this replaces runs of whitespace characters by
a single space.
- center(s, width)
- center(s, width) -> string
Return a center version of s, in a field of the specified
width. padded with spaces as needed. The string is never
truncated.
- count(s, *args)
- count(s, sub[, start[,end]]) -> int
Return the number of occurrences of substring sub in string
s[start:end]. Optional arguments start and end are
interpreted as in slice notation.
- expandtabs(s, tabsize=8)
- expandtabs(s [,tabsize]) -> string
Return a copy of the string s with all tab characters replaced
by the appropriate number of spaces, depending on the current
column, and the tabsize (default 8).
- find(s, *args)
- find(s, sub [,start [,end]]) -> in
Return the lowest index in s where substring sub is found,
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- index(s, *args)
- index(s, sub [,start [,end]]) -> int
Like find but raises ValueError when the substring is not found.
- join(words, sep=' ')
- join(list [,sep]) -> string
Return a string composed of the words in list, with
intervening occurrences of sep. The default separator is a
single space.
(joinfields and join are synonymous)
- joinfields = join(words, sep=' ')
- join(list [,sep]) -> string
Return a string composed of the words in list, with
intervening occurrences of sep. The default separator is a
single space.
(joinfields and join are synonymous)
- ljust(s, width)
- ljust(s, width) -> string
Return a left-justified version of s, in a field of the
specified width, padded with spaces as needed. The string is
never truncated.
- lower(s)
- lower(s) -> string
Return a copy of the string s converted to lowercase.
- lstrip(s)
- lstrip(s) -> string
Return a copy of the string s with leading whitespace removed.
- maketrans(...)
- maketrans(frm, to) -> string
Return a translation table (a string of 256 bytes long)
suitable for use in string.translate. The strings frm and to
must be of the same length.
- replace(s, old, new, maxsplit=-1)
- replace (str, old, new[, maxsplit]) -> string
Return a copy of string str with all occurrences of substring
old replaced by new. If the optional argument maxsplit is
given, only the first maxsplit occurrences are replaced.
- rfind(s, *args)
- rfind(s, sub [,start [,end]]) -> int
Return the highest index in s where substring sub is found,
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- rindex(s, *args)
- rindex(s, sub [,start [,end]]) -> int
Like rfind but raises ValueError when the substring is not found.
- rjust(s, width)
- rjust(s, width) -> string
Return a right-justified version of s, in a field of the
specified width, padded with spaces as needed. The string is
never truncated.
- rstrip(s)
- rstrip(s) -> string
Return a copy of the string s with trailing whitespace
removed.
- split(s, sep=None, maxsplit=-1)
- split(s [,sep [,maxsplit]]) -> list of strings
Return a list of the words in the string s, using sep as the
delimiter string. If maxsplit is given, splits into at most
maxsplit words. If sep is not specified, any whitespace string
is a separator.
(split and splitfields are synonymous)
- splitfields = split(s, sep=None, maxsplit=-1)
- split(s [,sep [,maxsplit]]) -> list of strings
Return a list of the words in the string s, using sep as the
delimiter string. If maxsplit is given, splits into at most
maxsplit words. If sep is not specified, any whitespace string
is a separator.
(split and splitfields are synonymous)
- strip(s)
- strip(s) -> string
Return a copy of the string s with leading and trailing
whitespace removed.
- swapcase(s)
- swapcase(s) -> string
Return a copy of the string s with upper case characters
converted to lowercase and vice versa.
- translate(s, table, deletions='')
- translate(s,table [,deletions]) -> string
Return a copy of the string s, where all characters occurring
in the optional argument deletions are removed, and the
remaining characters have been mapped through the given
translation table, which must be a string of length 256. The
deletions argument is not allowed for Unicode strings.
- upper(s)
- upper(s) -> string
Return a copy of the string s converted to uppercase.
- zfill(x, width)
- zfill(x, width) -> string
Pad a numeric string x with zeros on the left, to fill a field
of the specified width. The string x is never truncated.
|