Integer to Binary string

Ian Bicking ianb at colorstudy.com
Fri Dec 6 16:02:26 EST 2002


On Fri, 2002-12-06 at 10:39, srijit at yahoo.com wrote:
> I would like to know the most efficient Pythonic way to convert an
> integer to a binary string. Any suggestions?
> Is there any Python function similar to _itoa?

You might look at the marshal or pickle modules -- they both do
something of this type (as long as you aren't concerned about the
particular format of the string, just that it's compact and reversible).

-- 
Ian Bicking           Colorstudy Web Development
ianb at colorstudy.com   http://www.colorstudy.com
PGP: gpg --keyserver pgp.mit.edu --recv-keys 0x9B9E28B7
4869 N Talman Ave, Chicago, IL 60625 / (773) 275-7241





More information about the Python-list mailing list