The way to Convert Bytearray to String in Python
If you want to convert a Bytearray to a String in Python, then you are able to do the next:
Choice 1 – Utilizing bytes()
#
b = bytearray("take a look at", encoding="utf-8")
str1 = bytes(b)
print(str1)
Choice 2 – Utilizing bytearray.decode()
#
b = bytearray("take a look at", encoding="utf-8")
str1 = b.decode()
print(str1)