Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 python 将 JSON 对象转换为字符串。任何人都可以帮忙吗?我需要将此对象转换为字符串。
products = [ {'id':01,'description':'Hair tonic','price':'$20'}, {'id':02,'description':'Hair Shampoo','price':'$25'}, {'id':03,'description':'Hair Comb','price':'$10'}, ]
import json json.dumps(products)
http://docs.python.org/2/library/json.html