python sys stdout write flush