Converting bytes to a string in Python programming is easy. You have to use either the bytes.decode or the bytearray.decode option. Here is a code sample for using the decode option to convert bytes or byte array to a string.
Sample
## Converting bytes to string
bytValue = b'hello there'
print(bytValue)
strResult = bytValue.decode()
print(strResult)
## Converting bytearray to string
bytArray = bytearray('hello, how are you', 'utf-8')
print(bytArray)
strResult = bytArray.decode()
print(strResult)
Reference
- More about decoding bytes at Python docs.