Peter Faulks, 26.04.2012 19:57: > I want to extend an embedded interpreter so that calls to print() are > automagically sent to a C++ gui (windows exe) via a callback function in > the DLL. > > Then I'll be able to do this: > > ----test.py---- > import printoverload > > printoverload.set_stdout() > printoverload.set_stderr() > > print("this will be sent to a C function in printoverload.pyd") > ---------------
Why would you want to divert only "print" instead of changing sys.stdout in general? Not all output comes from print calls. Stefan -- http://mail.python.org/mailman/listinfo/python-list