[Tutor] extracting lines in large file

Lie Ryan lie.1296 at gmail.com
Tue Jun 23 21:03:48 CEST 2009


Bryan Fodness wrote:
> tried both again, they both return the same 9 lines, when i expect
> 492.  it dies on a blank line, but the if i_line takes care of the
> previous ones.
> 

Can you give a sample input that should, but not passed by the code?


Unrelated Tips:
You can rely on python's short-circuiting logical operator and write the
`if i_line` like this:

if i_line and i_line[0] == "intrinsic":
    ...



More information about the Tutor mailing list