Patching the typical output with the sys module is just what it feels like, but you should pay attention to a couple of gotchas: There isn’t an uncomplicated way to flush the stream in Python 2, since the print statement doesn’t allow for it by itself. You need to get https://bookmarketmaven.com/story19032017/what-does-print-mean