Is there an equivalent to the unless statement in Python? I do not want to append a line to a label if it has p4port in it:
unless
p4port
for lin
What about 'not in'?:
if 'p4port' not in line: labels.append(line)
Also i guess that you code can be modified then to:
if '@' in line and line == l and 'p4port' not in line: lineMatch = True labels.append(line.strip('\n').split('@')[1] + '\n')