Тот же самый код
A=b'["c1006","c1007"]'
json.loads(A)
работает в консоли Python, но не работает в ноутбуке Jupyter, говоря:
TypeError: the JSON object must be str, not 'bytes'
Почему и как исправить / записать переносимый файл?
Я использую Python 3.x в Linux:
(py36) dims@calculon:~$ python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> A= b'["c1006","c1007"]'
>>> json.loads(A)
['c1006', 'c1007']