getting fileinput to do errors='ignore' or 'replace'?
Adam Funk
a24061 at ducksburg.com
Mon Dec 7 09:46:58 EST 2015
On 2015-12-04, Oscar Benjamin wrote:
> Or you can use fileinput which is designed to be exactly this kind of
> context manager and to be used in this way. Although fileinput is slightly
> awkward in defaulting to reading stdin.
That default is what I specifically like about fileinput --- it's a
normal way for command-line tools to work:
$ sort file0 file1 file2 >sorted.txt
$ generate_junk | sort >sorted_junk.txt
--
$2.95!
PLATE O' SHRIMP
Luncheon Special
More information about the Python-list
mailing list