Favolas Favolas - 1 year ago 210
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 Source

How about two together?

bin(ord('P'))
# 0b1010000
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download