[Tutor] reading lines from a list of files
Peter Otten
__peter__ at web.de
Tue May 12 21:54:01 CEST 2015
Albert-Jan Roskam wrote:
> It was not that long ago that I found out about the fileinput module, so I
> sometimes forget to use it. It is not specify the encoding of the files,
> is it? It'd be nice if one could specify a tuple of encodings, e.g.
> ('utf-8-sig', 'latin1', 'cp1252').
>
> input(files=None, inplace=0, backup='', bufsize=0, mode='r',
> openhook=None)
> input([files[, inplace[, backup[, mode[, openhook]]]]])
Whatever you plan to do with these encodings, it should be possible with a
custom openhook.
More information about the Tutor
mailing list