On Fri, 04 Dec 2009 12:59:52 +0100, David Mugnai <[email protected]> wrote:
> 3) se le linee nel file hanno lunghezza fissa non usare il for ma andare
> di f.read(qualchekb)
file.__iter__ fa questo dietro le quinte. Infatti se vuoi davvero creare
un programma filtro in Python devi non solo usare "python -u", ma devi
anche sostituire il for con:
while 1:
line = f.readline()
if not line: break
...
--
Daniele Varrazzo - Develer S.r.l.
http://www.develer.com
_______________________________________________
Python mailing list
[email protected]
http://lists.python.it/mailman/listinfo/python