3 ms·
> Idk, it never occurred to me the need for a library that does more than "for line in sys.stdin:" Of course if you'd only used fileinput for that it would be
by masklinn 8y ago
> Idk, it never occurred to me the need for a library that does more than "for line in sys.stdin:"
Of course if you'd only used fileinput for that it would be worthless.
However what it does is way more useful, namely iterate on the lines of all files provided as parameter (or sys.argv[:1]), fallback to sys.stdin if no files were provided, and swap the special sentinel `-` by sys.stdin.