Python Bytes: JSON Tutorial

Опубликовано: 12 Июль 2021
на канале: CyberScribe.org
303
2

In this video I talk about working with JSON in Python.


Json Docs:
https://www.json.org/json-en.html

Python Json Docs:
https://docs.python.org/3/library/jso...

The JSON library is used to Serialize and Deserialized JSON object to/from Python dictionaries.

Serialize - convert / change into a format that can be stored and reconstructed later.

JSON is part of the Python standard libarary, just 'import json'.

Deserialize (convert to Python-usable structure, dict))
json.load(file containing json document) # load single Json document from file
json.loads(string) # load a string containing a json document (either from a file or other variable)

Serialize (convert to Json)
json.dump(python object, file object) # write a python dict to a file, serialized as json
json.dumps(python object) # dump a python dictionary to a json object, formatted as a string

JSON/Python Conversion Table
Json, Python
object, dict
array, list
string, str
number (int), int
number (real), float
true, True
false, False
null, None


На этой странице сайта вы можете посмотреть видео онлайн Python Bytes: JSON Tutorial длительностью online в хорошем качестве, которое загрузил пользователь CyberScribe.org 12 Июль 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 303 раз и оно понравилось 2 зрителям. Приятного просмотра!