python stdout readline to string