On Wed, 2011-07-13 at 00:35 -0400, Andreas Kloeckner wrote: > On Wed, 13 Jul 2011 14:14:03 +1000, Daryl Bond wrote: > > Hi, > > > > I am trying to log the output from my pyOpenCL kernel to a file. > > Using > > my standard method of grabbing sys.stdout does not seem to work if I > > have printf() statements in my code. The printf() output appears in > > the > > console output but not in sys.stdout. How should I be going about > > grabbing the printf() output from pyOpenCL?? > > Beware: you're entering the domain of evil hackery. > > You could try to dup2() your log file's file descriptor onto standard > output: > > http://docs.python.org/library/os.html#os.dup2 > > HTH, > Andreas
That works, although now I obviously don't have output to the console, but I can work with that. Unless of course you have more Python wizardry that could help me with feeding the output to stdout AND logfile? Many thanks. Daryl. _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
