page

Jul 30, 2019

TypeError : 'byte' and 'str'

in Python3,  'byte'  type was introduced.
It might make TypeErr if run in Python2 and Python3

https://stackoverflow.com/questions/33054527/typeerror-a-bytes-like-object-is-required-not-str-when-writing-to-a-file-in


you can convert 'byte' to 'str'

strType=byteType.decode("utf-8")

https://stackoverflow.com/questions/606191/convert-bytes-to-a-string



No comments:

Post a Comment