API Help

Grant Edwards grant.b.edwards at gmail.com
Wed Jun 14 18:49:36 EDT 2017


On 2017-06-14, Erik <python at lucidity.plus.com> wrote:
> On 14/06/17 22:54, Ray Cote wrote:
>> Definitely JSON:
>>>>>
>> json.loads(“""[{"itemNumber":"75-5044","inventory":[{"warehouseCode":"UT-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"KY-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"TX-1-US","quantityAvailable":14.0000000000000},{"warehouseCode":"CA-1-US","quantityAvailable":4.0000000000000},{"warehouseCode":"AB-1-CA","quantityAvailable":1.0000000000000},{"warehouseCode":"WA-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"PO-1-CA","quantityAvailable":0.0000000000000}]}]""")
[...]
>
> If that makes it definitely JSON, then this makes it definitely Python ;) :
> >>> 
> [{"itemNumber":"75-5044","inventory":[{"warehouseCode":"UT-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"KY-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"TX-1-US","quantityAvailable":14.0000000000000},{"warehouseCode":"CA-1-US","quantityAvailable":4.0000000000000},{"warehouseCode":"AB-1-CA","quantityAvailable":1.0000000000000},{"warehouseCode":"WA-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"PO-1-CA","quantityAvailable":0.0000000000000}]}]

Indeed.

> So, I think we're agreed that it's definitely one or the other.

It's both a floor wax _and_ a dessert topping!

-- 
Grant




More information about the Python-list mailing list