Problems redirecting STDOUT (NOT sys.stdout) to a pipe.
I am trying to capture some printf's from a C function called by
<Working under winxp>
I have tried to following:
STDOUT = 1 # stdout fd
(re, we) = os.pipe() # Create re / write handlers
dup2(we, STDOUT) # override system's stdout, should dup first and
call_my_hello_world() # if stdout is not overriden will print hello
world on console screen
x = os.read(re, 11)
sadly, x = '' after the code is executed.
help ? :-)
|All times are GMT. The time now is 09:33 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.