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:
for lin
The error you're getting in your (rather drastically) edited question is telling you that the variable lineMatch doesn't exist - which means the conditions you specified for setting it weren't met. It might help to add a line like LineMatch = False as the first line inside your outer for loop (before the first if statement), to ensure that it does exist.