此代码删除了红色,但我无法删除其他颜色。
def removeRed(inLines, outfile):
for i in range(3, len(lines)):
line = lines[i]
nums = line.split()
outLine = ''
for j in range(len(nums)):
if j % 3 == 0:
outLine = outLine + '0 '
else:
outLine = outLine + nums[j] + ' '
outfile.write(outLine + '\n')