1 Star 0 Fork 0

江旭川/笔记

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
json_test.py 760 Bytes
一键复制 编辑 原始数据 按行查看 历史
江旭川 提交于 2021-12-14 06:35 . 学习笔记
import json
# historyTransactions = [
#
# {
# 'time' : '20170101070311', # 交易时间
# 'amount' : '3088', # 交易金额
# 'productid' : '45454455555', # 货号
# 'productname' : 'iphone7' # 货名
# },
# {
# 'time' : '20170101050311', # 交易时间
# 'amount' : '18', # 交易金额
# 'productid' : '453455772955', # 货号
# 'productname' : '奥妙洗衣液' # 货名
# }
#
# ]
#
# jsonstr = json.dumps(historyTransactions)
# print(jsonstr)
data = [{'a':1,'b':2,'c':3}]
print('未转换前的类型是:',type(data))
data2 = json.dumps(data)
print('转换后的类型是:',type(data2))
print(data2)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jiang-xuchuan/note.git
git@gitee.com:jiang-xuchuan/note.git
jiang-xuchuan
note
笔记
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385