On Mon, May 12, 2014 at 1:42 PM, MRAB <python at mrabarnett.plus.com> wrote: > How about checking sys.stdin.mode and sys.stdout.mode? Seems to work, but I notice that the docs only define the mode attribute for the FileIO class, which sys.stdin and sys.stdout are not instances of.