1、字典写入txt dic = { 'andy':{ 'age': 23, 'city': 'beijing', 'skill': 'python' }, 'william': { 'age': 25, 'city': 'shanghai', 'skill': 'js' } } fw = open("test.txt",'w+') fw.write(str(dic)) #把字典转化为str fw.close() 2、读取txt中字典 fr = open("test....