Bypassing buffering of subprocess output with popen in C or Python

前端 未结 2 535
孤街浪徒
孤街浪徒 2020-12-05 15:49

I have a general question about popen (and all related functions), applicable to all operating systems, when I write a python script or some c code and run the resulting exe

2条回答
  •  萌比男神i
    2020-12-05 16:15

    Thats correct, and applies to both Windows and Linux (and possibly other systems), with popen() and fopen(). If you want the output buffer to be dispatched before 4096 bytes, use fflush() (on C) or sys.stdout.flush() (Python).

提交回复
热议问题