清空原文件内容

 

 

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)

  

 

文件指针

 

posted @ 2018-05-19 15:34  papering  阅读(159)  评论(0编辑  收藏  举报