Mar-01-2019, 02:14 PM
Mar-01-2019, 03:55 PM
It's not binary,but bytes.
Where dos data in you list come from?
All data that come into Python 3 most have encoding,if not it will be bytes.
This is because of Unicode,which was one biggest changes moving to Python 3.
Can convert with
Where dos data in you list come from?
All data that come into Python 3 most have encoding,if not it will be bytes.
This is because of Unicode,which was one biggest changes moving to Python 3.
Can convert with
decode()
encode()
.>>> lst = [b'value', b'hello', b'9999'] >>> lst[0] b'value' >>> type(lst[0]) <class 'bytes'> >>> # To str also default Unicode text Python 3 >>> lst[0].decode() # Same as .decode('utf-8') 'value' >>> [i.decode() for i in lst] ['value', 'hello', '9999']Can also work with bytes,eg string method works.
>>> lst[0].upper() b'VALUE'
Mar-01-2019, 05:08 PM
thank for the help, is very well explained.