标签:load core utf-8 def cal lock str nic self
参考: https://blog.csdn.net/qq_29201493/article/details/85697377
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : garbage_test.py
@Time : 2019/06/15 08:26:17
@Author : California Fruit
@Desc : None
'''
import json
class Student(object):
def __init__(self, name, age, score,reward):
self.name = name
self.age = age
self.score = score
self.reward = reward
def json_2str():
data_json = {'name':'nick',
'age':12}
json_str = json.dumps(data_json)
print type(json_str), json_str
def str_2json():
json_str = '{"age": 12, "name": "nick"}'
json_class