Favolas Favolas - 6 months ago 23
Python Question

Python ASCII to binary

Is there a builtin function that converts ASCII to binary?

For example. converts 'P' to 01010000.

I'm using Python 2.6.6

Answer

How about two together?

bin(ord('P'))
# 0b1010000
Comments