Reo's recent timeline updates
Reo

Reo

V2EX member #95580, joined on 2015-02-03 19:36:17 +08:00
Reo's recent replies
@paloalto :Hi paloalto, 我刚学Python, 现在也有一个跟你一样的问题想解决。能把你对于这个问题的代码share一下吗?非常感谢~
我写的代码还是有问题,list_2 中如果某行包含list_1中的某行,这样的就删不掉(我的是把包含的输出到一个文件中),只有当list_2和list_1两行完全一样才被删掉。我的代码如下:
fileOne = open("a.txt", "r").readlines()
fileTwo = open("b.txt", "r").readlines()
outFile = open("c.txt", "w")
for i in fileOne:
for j in fileTwo:
if j in i:
outFile.write(i)
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3066 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 12:55 · PVG 20:55 · LAX 05:55 · JFK 08:55
♥ Do have faith in what you're doing.