Paolo Pantaleo wrote: > So I tried this > > if(not (attr=global_re.match(line)) ): > break > > it says invalid syntax [on the =] > so it is not possible to do test and assignment in C style? > how can I write this otherwise? > With fewer parentheses for a start, but all you have to do here is to do the assignment and the test on separate lines:
attr = global_re.match(line) if not attr: break In other cases you may have to work a bit harder to restructure your code. -- http://mail.python.org/mailman/listinfo/python-list