"Chris Rebert" <c...@rebertia.com> wrote:

> It's not quite clear to me what you mean, but here are 2 guesses:
> - If you want to convert an ASCII character to its ASCII integer
> value, use ord()
> - If you want to convert an integer into a string of its base-2
> representation, use bin() [requires Python 2.6, I think]

Another case:

>>> s = '1010101'
>>> int (s,2)
85
>>> 

Works almost anywhere, AFAIK.

- Hendrik

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to