Converting to a base 2,

AMR alvaro at ocse.infonegocio.com
Wed May 10 03:44:48 EDT 2000


Yes Warren,
I feel I didn't expressed very well,
I want to convert as you say to a base 2.
I only want to know the module I have to import and the function,

I tried with this and... of course run,
x = binstr(42)
y = string.atoi(x,2)
print x
print y

Thanks to all,

--
Alvaro Martínez
Optichrome Computer Systems España, S.A.

Tel. (+34) 917 242 670        Fax. (+34) 917 130 360

alvaro at ocse.infonegocio.com
http://www.optichrome.com
"Warren Postma" <embed at geocities.com> escribió en el mensaje
news:slXR4.17758$HG1.457019 at nnrp1.uunet.ca...
> >
> > struct.pack( 'i', yourinteger )
> >
> > Enjoy,
> > Mike
>
> Interesting how ambiguous "convert to binary is". I assumed he meant
"print
> an integer variable as a base-2 (binary) string representation". ;-)
>
> Warren
>
>





More information about the Python-list mailing list