I know this is easily possible in python 2.6. But what is the easiest way to do this in Python 2.5?
x = "This is my string"
b = to_bytes(x) # I could do this easily in 2.7 using bin/ord 3+ could use b"my string"
print b
Any suggestions? I want to take the x and turn it into
00100010010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011101000111001001101001011011100110011100100010
echo -n 'This is my string' | xxd -b
– Ariew