Comment

Comment by inklesspen

If you want to work with bytes on stdin and stdout, Python 3 documents how to do that, at the same place it documents the stdin and stdout streams.

https://docs.python.org/3/library/sys.html#sys.stdin

All you have to do is use sys.stdin.buffer and sys.stdout.buffer; the caveat is that if sys.stdin has been replaced with a StringIO instance, this won't work. But in Armin's simple cat example, we can trivially make sure that won't happen.

I'd be a lot more willing to listen to this argument if it didn't overlook basic stuff like this.

parent inklesspen 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton