Python中的语法是否正确?
(if 'SU' in line or 'AU' in line or 'VU' in line or 'rf' in line and line.find('/*') == -1) and (BUILDROOT in line):
lineMatch = False
答案 0 :(得分:7)
试试这个:
if any(x in line for x in ('SU', 'AU', 'VU', 'rf')) and '/*' not in line and BUILDROOT in line:
lineMatch = False
答案 1 :(得分:5)
不,if
不应该在括号内。