擅长:python、mysql、java
<p>这个怎么样?在</p>
<pre><code>l = [{'label_1': 'labelone', 'value_1': 'valueone', 'label_2': 'label two', 'value_2':'v2'}]
values = int(len(l[0])/2)
dicts = []
for i in range(values):
label_name = 'label_%s' % (i+1)
value_name = 'value_%s' % (i+1)
dicts.append({'label':l[0][label_name], 'value':l[0][value_name]})
</code></pre>