Access violation while trying to replace stdout with a local disk file
huiray at gate.sinica.edu.tw
Mon Nov 29 12:35:34 EST 1999
Hi there !
I'm trying to redirect the output of Python into a external diskfile
since my program and python interpretor are two different processes
(python15.dll and myprog.exe)
PyObject_Print() will cause a "Access Violation" while trying to
print on the file handle which is created by myprog.exe
any suggestion will be greatly appreciated.
please cc to csyap at pd.jaring.my
thank you in advance.
output = fopen("adiskfile","w");
new_stdout = PyFile_FromFile(output, "<stdout>", "w", NULL);
fprintf(output,"testing"); // <- it works
v = PyRun_String("print 1+2", Py_single_input, globals, globals); // <-
it doesn't works
More information about the Python-list