Em Sex, 2006-04-14 às 20:33 +0200, Diez B. Roggisch escreveu:
> def read_lines(inFile):
>      fg = iter(inFile)
>      for line in fg:
>          if "pmos4_highv" in line:
>              fg.next()
>          else:
>              yield line

Just be aware that the "fb.next()" line can raise an StopIteration
exception that would otherwise be caught by the for loop. If you have
any resources that need to be cleaned up, try...finally is you friend.

-- 
Felipe.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to