Handling json with python
Json was originally a structure to describe an object in Javascript, but now it is widely used to describe a universal data structure. In particular, it is widely used as a data protocol for sending and receiving data in http, tcp/ip communication. Working with Json in Python is as easy as Javascript. Basic JSON handling To handle JSON in Python, import the json module. The json module is provided by default in Python, so there is no need to install it using pip. Read json from file This is a method of reading json data from a file that stores json data. After importing the json module, you can import data through the load function. import json filename = "C: \\ lsh \\ study \\ json \\ drink.json" with open(filename, 'r' ) as f: json_data = json . load (f) print(json . dumps(json_data) ) Run the program, yes, I can get the good result. For reference, the json.dumps function used for screen output converts json data in dictionary forma...