Flush stdout in python client