카테고리 없음

How to convert between bytes and strings in Python 3?

sngjuk 2017. 11. 16. 22:45
str1 = b'hello world'
str2 = bytes("hello world", encoding="UTF-8")
print(str1 == str2) # Returns True

https://stackoverflow.com/questions/14010551/how-to-convert-between-bytes-and-strings-in-python-3