![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: Need help removing list elements.
From: Max Erickson <maxerickson@gmail.com>
Date: Sat Apr 29 2006 - 16:22:34 CEST
nuffnough@gmail.com wrote in
> But this gives me "IndexError: list out of range
You are making the list shorter as you are iterating. By the time your
returned_lines=[line for line in open("lines.txt", 'rb')
or just
returned_lines=[line for line in open("lines.txt") if line]
max
|