itoa

Stuart Reynolds S.I.Reynolds at cs.bham.ac.uk
Tue Mar 14 05:59:12 EST 2000


Moshe Zadka wrote:
> 
> On Mon, 13 Mar 2000, Stuart Reynolds wrote:
> 
> > Is there an integer to ascii (itoa) function in Python? I need to
> > convert integers into various different bases (but to binary, in
> > particular). Most languages come provided with an itoa-like function but
> > I can't seem to find one in the Python API.
> 
> Have a look at the builtin "str" function

Thanks, but this only does base 10.

>>> help(str)
str(object) -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Stuart



More information about the Python-list mailing list