
使用python给文件test.html中所有的hello world中间添加一个the
1个回答
展开全部
fileopen= open('test.html')
filrout = open('new_test.html','w')
for i in fileopen:
filrout.write( i.strip().replace('hello world','hello the world')+'\n')
fileopen.close()
filrout.close()
filrout = open('new_test.html','w')
for i in fileopen:
filrout.write( i.strip().replace('hello world','hello the world')+'\n')
fileopen.close()
filrout.close()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |