python import hjson with open('config.hjson') as f: hjson_data = hjson.load(f) json_data = hjson.loads(hjson_data) print(json_data) python import hjson json_data = { "name": "John", "age": 30, "city": "New York" } hjson_data = hjson.dumps(json_data) print(hjson_data) hjson { # This is a comment "name" : "John", "age" : 30, // This is another comment "city" : "New York" } hjson { "description" : ''' This is a multiline string ''' }


上一篇:
下一篇:
切换中文