On 2021-01-16, Chris Angelico <ros...@gmail.com> wrote: > On Sat, Jan 16, 2021 at 1:36 PM Greg Ewing <greg.ew...@canterbury.ac.nz> > wrote: > >> Can something be done about this? Maybe Python stdio objects >> should flush all the C stdio streams before writing anything? >> > > Surely it should be the other way around? If you use the C stdio > streams, flush them after use. Like with everything else that you > flush.
If you want to be able to mix Python output and FILE* output, you have to flush either/both. You have to flush the Python output everytime you do a FILE* output, and you have to fflush the FILE* stream every time you do Python output. Or you have to keep track of which you did last time. It's very ugly. -- Grant -- https://mail.python.org/mailman/listinfo/python-list