utils/create_url_polemics_param.py
changeset 38 dfb5081e8ebe
parent 37 2d0e6a207048
child 39 c922bf9167aa
equal deleted inserted replaced
37:2d0e6a207048 38:dfb5081e8ebe
    14         for sc in c["subcategories"]:
    14         for sc in c["subcategories"]:
    15             output.append({"name": sc["code"],"keywords": [ sc["label"] ], "color" : sc["color"] })
    15             output.append({"name": sc["code"],"keywords": [ sc["label"] ], "color" : sc["color"] })
    16     else:
    16     else:
    17         output.append({"name": c["code"],"keywords": [ c["label"] ], "color" : c["color"] })
    17         output.append({"name": c["code"],"keywords": [ c["label"] ], "color" : c["color"] })
    18 
    18 
       
    19 output_str = json.dumps(output, separators=(',',':'))
    19 print "SIMPLE JSON DUMPS :"
    20 print "SIMPLE JSON DUMPS :"
    20 print json.dumps(output)
    21 print output_str
    21 print "\nURLLIB QUOTE_PLUS JSON DUMPS :"
    22 print "\nURLLIB QUOTE_PLUS JSON DUMPS :"
    22 print urllib.quote_plus(json.dumps(output))
    23 print urllib.quote_plus(output_str)