Jython

Boris Ozegovic silovana.vjeverica at com.gmail
Sat Feb 3 11:38:34 EST 2007


gregturn at mindspring.com wrote:

> Files aren't lists and thus don't have the functions for iteration.
> 
> Try:
> 
> def go():
>         for line in open("bobo.txt", "r").readlines():
>                 print line
> 
> go()

For example, you can do even this:

import sys

for line in sys.stdin:
	print line, 


python FileReader.py < bobo.tx

'import site' failed; use -v for traceback
boris ozegovic
vedran ozegovic

-- 
"A mi smo stranci u vlastitoj zemlji zbog ljudskog sljama, lipa nasa
silovana"



More information about the Python-list mailing list