I have some code like:
if '@' in line and line == l:
lineMatch = True
line = line.strip('\n')
line = line.split('@')[1]
line = line + '<br>\n'
labels.append(line)
I do not want to append a line to a label if it has p4port in it. Is there something like unless in Python, that would allow me to write something like labels.append(line) unless 'p4port' in line?
What about ‘not in’?:
Also i guess that you code can be modified then to: