write multiple files at a time

前端 未结 5 486
长情又很酷
长情又很酷 2021-01-13 20:04

I have a file with 196 list in it,and I want to create new 196 output files and write each of the list in a new file, so that I will have 196 output files each containing 1

5条回答
  •  离开以前
    2021-01-13 20:15

    your f is a list of files, you have to loop through it:

    for file in f:
       file.write(value)
    

提交回复
热议问题