#写入new文件 import json dic = {'name':'alex'} i = 8 s = 'hello' l = [11,22] f = open("new_hello","w") date = json.dumps(dic) f.write(date)