logo       

Re: Re: using stdout/stderr with python: msg#00150

programming.swig

Subject: Re: Re: using stdout/stderr with python

Martin F Krafft wrote:
also sprach Kevin Smith <wxruby@xxxxxxxxxxxxxxx> [2004.05.25.1748 +0200]:

One way would be to create C functions like GetStdin and
GetStdout, and wrap them. This way, from Python, you could get
access to FILE* versions of those streams. Then, you can pass
those values back into your other functions.

Yes, but I try to avoid that. It's requires changing the library,
does it not? Sure, one could provide an additional C file, but
why??? This must be doable in a better way.

If this approach will work for you, you can do it without modifying the C library. You can declare and define helper functions like this within your SWIG .i file. See the SWIG docs, SWIG Basics, Section 4.6.2.

Cheers,

Kevin
_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise