four json file handling functions

import json 

using # json.dumps (json_dict, ensure_asscii = False ) function, the dictionary into a string 
	ensure_ascii = False Chinese characters of Unicode compiled to 

use functions # json.loads (json_str), the string into the dictionary 
	. encode ( 'utf-8') returns the data type is normal dict format 

# json.dump (data, flie) function is used, the information is written into the file json encoding 

# json.load (flie) function is used, the json read information, decoding

 

Guess you like

Origin www.cnblogs.com/7134g/p/11516894.html