【发布时间】:2017-05-16 21:45:14
【问题描述】:
我有一个包含很多行的数据,如下所示:
<br>  <font size="4">•</font>  Closed Point 3<br>  <font size="4">•</font>  Opened Shape<br>
我想在行中搜索单词“Point”,如果找到它只删除这部分:
<br>  <font size="4">•</font>  Closed Point 3
所以 它只会离开:
<br>  <font size="4">•</font>  Opened Shape<br>
我被困在这里:
with open(input, 'r') as f:
lines = f.readlines()
with open(output, 'w') as w:
for line in lines:
if 'Point' in line:
【问题讨论】:
标签: python string text between