Writing to files from C functions
sbarron at twilight.
Sat Nov 6 05:14:20 CET 1999
I have a C library with a couple of functions along these lines:
int foo (int d, int v)
fd = fopen ("logfile.log", "a");
fprintf ("called foo on %d with arg %d\n", d, v);
I have used SWIG to generate wrappers for this library and all is mostly
well. However, I'd like to 'tail -f' the log file while im in the Python
interactive interpreter but the data isn't written to the file until I
exit the Python interpreter. Is Python not actually flushing my file as
I ask or is my C code incorrect?
More information about the Python-list