with open(f'./电影_2_new.txt', mode='w',encoding='utf-8') as f: for i in lines: f.write(i)
时间: 2024-05-22 15:13:09 浏览: 57
open在python中的用法.docx
This code writes the contents of the variable "lines" to a new file named "电影_2_new.txt" in write mode with UTF-8 encoding. Each element in "lines" is written to the file as a separate line.
阅读全文