Some source code

Jarek Zgoda jzgoda at gazeta.usun.pl
Sun Feb 22 11:43:55 EST 2004


Adam Przybyla <adam at gliwice.pl> pisze:

>> file('output.txt','w').writelines(['%s,"%s"\n' % (line[:-1],
>>     sum(map(int,line[1:-2].split('","')))) for line in
>>     file('input.txt')])
> file('output.txt','w').writelines(['%s,"%s"\n' % 
>       (line[:-1],sum(eval(line[1:-2]))) for line in file('input.txt')])

You still call this code "pythonic"?

-- 
Jarek Zgoda
http://jpa.berlios.de/



More information about the Python-list mailing list