import chardet
a='haha'
print(chardet.detect(a))
TypeError: Expected object of type bytes or bytearray, got: < class 'str'>
I just type code from tutorial. I really can not figure out what wrong happended.
import chardet
a='haha'
print(chardet.detect(a))
TypeError: Expected object of type bytes or bytearray, got: < class 'str'>
I just type code from tutorial. I really can not figure out what wrong happended.
To convert a string to a byte...
Change:
To: