0

Is there an existing library that can directly convert a binary in string format to a real binary object in Python?

For example, how to convert '1100' (string) to '0b1100' (byte)?

3
  • 1
    int('1100', 2) Commented Aug 5, 2021 at 7:47
  • int('1100', 2) returns an Integer, NOT byte. Commented Aug 5, 2021 at 7:49
  • 1
    0b1100 would also be an integer. See the duplicate how to progress from there. Commented Aug 5, 2021 at 7:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.