Re: [Swig-user] How to receive a FILE* from Python under MinGW?

2007-03-21 Thread Carl Douglas
On 3/22/07, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > On 21/03/2007 6.49, Carl Douglas wrote: > > > Hi John, > > > > In my case, all I needed was a PyFile_AsFile to get the File *. > > However I found that Python errors going to stdout/stderr were not > &

Re: How to receive a FILE* from Python under MinGW?

2007-03-20 Thread Carl Douglas
On 20 Mar 2007 23:12:45 -0700, John Pye <[EMAIL PROTECTED]> wrote: > On Mar 21, 4:49 pm, "Carl Douglas" <[EMAIL PROTECTED]> wrote: > > 1) Rebuild Python with a different compiler/linker kit so it links to > > the same CRT as my project, in your case find a ming

Re: [Swig-user] How to receive a FILE* from Python under MinGW?

2007-03-20 Thread Carl Douglas
gt; > And > http://mail.python.org/pipermail/python-list/2007-March/430695.html > http://groups.google.com/group/comp.lang.python/browse_frm/thread/6d7569e7fd996daf/ > http://groups.google.com/group/comp.lang.python/browse_frm/thread/17558adbc053f26d/ > > Carl Douglas wrote: >

Re: [Swig-user] How to receive a FILE* from Python under MinGW?

2007-03-20 Thread Carl Douglas
Hi John, I had exactly this problem... use the PyFile_AsFile function. Below is a code snippet from my project: // Thank you: http://www.ragestorm.net/tutorial?id=21#8 PyObject* PyFileObject = PyFile_FromString(ofn.lpstrFile, "r"); if (PyFileObje

Re: Embedded and extending python 2.5: trouble with __main__ in PyRun_SimpleFileExFlags?

2007-03-04 Thread Carl Douglas
} if (PyRun_SimpleFile(PyFile_AsFile(PyFileObject), ofn.lpstrFile) == -1) { PyErr_Print(); PyErr_Clear(); } Py_DECREF(PyFileObject); } On 2/19/07, Carl Douglas <[E

Embedded and extending python 2.5: trouble with __main__ in PyRun_SimpleFileExFlags?

2007-02-19 Thread Carl Douglas
Hi Python fans, I am developing a DLL that is loaded by a host application on windows. I'm using python 2.5. My DLL uses an embedded python interpreter which can access the host application through an API which I have exposed using SWIG 1.3.31. Therefore I have both extended and embedded Python