摘要: 当使用 json.dumps(books) 无法序列化的时候报如下错误 解决方法: json.dumps(books,ensure_ascii=False,default=lambda o:o.__dict__) __dict__的方法是 已字典格式返回 类里所有实例化的变量 如a类 class a 阅读全文
posted @ 2020-05-06 03:38 凯宾斯基 阅读(221) 评论(0) 推荐(0)
摘要: class a(): def a1(self): print (123) def __test3(self): #私有函数,其他脚本文件是无法调用的,函数命名规则就是前面加 __(2个下划线) print ("私有函数") 阅读全文
posted @ 2020-05-06 01:22 凯宾斯基 阅读(295) 评论(0) 推荐(0)