recent call last):
File "", line 1, in
json.dumps({1,2,3,4})
File "C:\Python36...\lib\json\__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "C:\Python36...\Python36\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "C:\Python36...setDecoder(json.JSONDecoder):
def decode(self, obj):
return set(json.JSONDecoder.decode(self, obj))
# 使用自定义的编码器和解码器...程序设计基础》、
《Python程序设计》(第2版)、
《Python可以这样学》
清华大学出版社'''
# 将内容序列化并写入文本文件
>>> with open('test.txt', 'w') as