trans_width_table表如下:
{frozenset({2}): {3: 250, 2.5: 100, 1.5: 25, 2: 50, 1.8: 50, 2.75: 200, 5: 350, 4: 350, 2.3: 100, 4.5: 350, 3.5: 300}, frozenset({1, 3, 4, 5}): {2.5: 75, 2.75: 100, 1.5: 25, 4: 300, 3.5: 200, 4.5: 300, 3: 100, 5: 300, 2.3: 50, 2: 25, 1.8: 25}, frozenset({8, 9, 6, 7}): {5: 250, 1.8: 25, 1.5: 25, 4: 150, 2.3: 25, 2: 25, 2.75: 50, 2.5: 50, 3: 50, 4.5: 150, 3.5: 50}}
25
源码
输出
原因:从json读取的数据是text类型,需要将其转化为列表,我这里用的是eval()函数。源码修改之后如下:
再次输出正确结果:
感谢大家的支持和关注!!