mapping the read() fonction

Peter Schneider-Kamp nowonder at pool.informatik.rwth-aachen.de
Tue Jul 25 01:40:57 EDT 2000


Benjamin wrote:
> 
> I would like to map the read() function of a file object

Just use a lambda like this:

map(lambda f:open(f,"r").read(), list_of_filenames)

Peter
--
Peter Schneider-Kamp          ++47-7388-7331
Herman Krags veg 51-11        mailto:peter at schneider-kamp.de
N-7050 Trondheim              http://schneider-kamp.de




More information about the Python-list mailing list