方法一:
1: A = { 'a': 1, 'b': 2}
2:
3: for k,v in A.items():
4: exec k+ '='+str(v)
5:
6:
print b
7:
>>>2
方法二:
A = {
'a': 1, 'b': 2}
for k,v in A.items():
vars()[k]=v
print a
>>>1