|
Re: Re: using stdout/stderr with python: msg#00138programming.swig
On 2004.05.25 17:48, Kevin Smith wrote: Martin F Krafft wrote: This wouldn't help when next he wants to pass a Python file handle created with open(). From a quick look at the Python/C API (see http://www.python.org/doc/2.3.3/api/fileObjects.html) the following might work: %typemap(in) FILE* { if (PyFile_Check($input)) { $1 = PyFile_AsFile($input); } else { SWIG_exception(SWIG_TypeError, "file expected"), } } but I haven't tested it, so I don't guarantee that it won't cause scripts to crash horribly. Hope this helps, Luigi _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: using stdout/stderr with python: 00138, Kevin Smith |
|---|---|
| Next by Date: | RE: renaming the .so in C->python: 00138, William . Fulton |
| Previous by Thread: | Re: Re: using stdout/stderr with pythoni: 00138, Kevin Smith |
| Next by Thread: | Re: Re: using stdout/stderr with python: 00138, Marcelo Matus |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |