Binary String to Binary Type in Python

Viewed 22

I have a binary string "b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x0".

binary_strig = "b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x0"
type(binary_strig)
str

I need to get a binary type in python:

binary_variable = b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x0"
type(binary_variable)
binary

Please help how to cast or transfor str python to binary type

0 Answers
Related