prefix = "###" # 前缀
index = 3 # 第四行
with open("1.txt","r") as f:
datalist=f.readlines()
用python批量在txt文件内容中第四行加前缀怎么写呀
![](https://img-home.csdnimg.cn/images/20240711042549.png)
prefix = "###" # 前缀
index = 3 # 第四行
with open("1.txt","r") as f:
datalist=f.readlines()