unless statement in Python

前端 未结 3 402

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         


        
3条回答
  •  春和景丽
    2021-01-07 19:04

    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.

提交回复
热议问题