Disable output buffering
From Magnus Lycka answer on a mailing list: You can skip buffering for a whole python process using python -u (or #!/usr/bin/env python -u etc.) or by setting the environment variable PYTHONUNBUFFERED. You could also replace sys.stdout with some other stream like wrapper which does a flush after every call. class Unbuffered(object): def __init__(self, stream): … Read more