with open(res_f_cut, 'w') as fw: s = '\n'.join(['{}\n{}'.format(k, ','.join([str(i) for i in d[k][0:children_val_max]])) for k in d]) #fw.write(s)
文件指针