From collectionsImport Chainmap
Import Collections
Value = Chainmap ()
For List_numInchRange1,13):
Li_list = List_num +1
value["li_name%s"% (list_num)] = Li_list
Value=Value.new_child ()#添加字典到集合
value= value.parents #取出一个空字典
print ( value) #打印合并后的字典
print (dict ( Value) #从对象中提取字典
+++++++++++++++++++++++++++++++++++++ ++++++++++
C:\python3.7\python.exe d:/python-test/stuproject/stuapp/tests.py
Chainmap ({' li_name1 ': 2, ' Li_ Name2 ': 3, ' Li_name3 ': 4, ' li_name4 ': 5, ' li_name5 ': 6, ' Li_name6 ': 7, ' Li_name7 ': 8, ' Li_name8 ': 9, ' li_name9 ': ten, ' Li_n Ame10 ': One, ' li_name11 ':, ' li_name12 ': +} '
{' li_name1 ': 2, ' li_name4 ': 5, ' li_name11 ': +, ' li_name2 ': 3, ' li_name1 2 ': +, ' li_name7 ': 8, ' Li_name8 ': 9, ' li_name5 ': 6, ' li_name10 ': One, ' Li_name3 ': 4, ' li_name9 ': Ten, ' Li_name6 ': 7}
Python merges multiple dictionaries to form a dictionary