({"goodsname": "山核桃仁", "goodscode": f"sp_{goods_cod}1" }, "success!")怎么转换成json格式
时间: 2024-01-16 20:19:05 浏览: 75
转化成json格式
3星 · 编辑精心推荐
```python
import json
data = ({"goodsname": "山核桃仁", "goodscode": f"sp_{goods_cod}1"
}, "success!")
json_data = json.dumps(data)
print(json_data)
```
输出结果为:
```json
[{"goodsname": "山核桃仁", "goodscode": "sp_12341"}, "success!"]
```
阅读全文