Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
"exec" "python" "-u" "--" "$0" "$@"
import os
import sys
import time
class ForceIOStream:
def __init__(self, stream): = stream
def write(self, data):
if not
def __getattr__(self, attr):
return getattr(, attr)
sys.stdout = ForceIOStream(sys.stdout)
sys.stderr = ForceIOStream(sys.stderr)
for i in xrange(20):
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment