Re: c++ extension, problem passing argument

2009-03-14 Thread Matteo
On 14 Mar, 02:08, Aaron Brady wrote: > On Mar 13, 5:42 pm, Matteo wrote: > > > > > On 13 Mar, 22:35, Aaron Brady wrote: > > > > On Mar 13, 1:34 pm, Matteo wrote: > > > > > hmmm... looks like SWIG has a problem with double pointers. I googled > > > > around a bit and found: > > > > >http://osdir

Re: c++ extension, problem passing argument

2009-03-13 Thread Aaron Brady
On Mar 13, 5:42 pm, Matteo wrote: > On 13 Mar, 22:35, Aaron Brady wrote: > > > > > On Mar 13, 1:34 pm, Matteo wrote: > > > > hmmm... looks like SWIG has a problem with double pointers. I googled > > > around a bit and found: > > > >http://osdir.com/ml/programming.swig/2003-02/msg00029.html > > >

Re: c++ extension, problem passing argument

2009-03-13 Thread Matteo
On 13 Mar, 22:35, Aaron Brady wrote: > On Mar 13, 1:34 pm, Matteo wrote: > > > hmmm... looks like SWIG has a problem with double pointers. I googled > > around a bit and found: > > >http://osdir.com/ml/programming.swig/2003-02/msg00029.html > > > anyone knows how to write a small wrapper to do th

Re: c++ extension, problem passing argument

2009-03-13 Thread Aaron Brady
On Mar 13, 1:34 pm, Matteo wrote: > hmmm... looks like SWIG has a problem with double pointers. I googled > around a bit and found: > > http://osdir.com/ml/programming.swig/2003-02/msg00029.html > > anyone knows how to write a small wrapper to do the appropriate > dereferencing? 'ctypes' may be a

Re: c++ extension, problem passing argument

2009-03-13 Thread bobicanprogram
On Mar 13, 1:34 pm, Matteo wrote: > hmmm... looks like SWIG has a problem with double pointers. I googled > around a bit and found: > > http://osdir.com/ml/programming.swig/2003-02/msg00029.html > > anyone knows how to write a small wrapper to do the appropriate > dereferencing? If you can't sol

Re: c++ extension, problem passing argument

2009-03-13 Thread Matteo
hmmm... looks like SWIG has a problem with double pointers. I googled around a bit and found: http://osdir.com/ml/programming.swig/2003-02/msg00029.html anyone knows how to write a small wrapper to do the appropriate dereferencing? -- http://mail.python.org/mailman/listinfo/python-list

Re: c++ extension, problem passing argument

2009-03-13 Thread Matteo
On 13 Mar, 18:19, Aaron Brady wrote: > On Mar 13, 12:03 pm, Matteo wrote: > > > > > Hi all, > > > I wrote a few c++ classes for some data analysis on a physics > > esperiment. Now I want to glue the lot with Python, so I built the > > necessary wrap code with SWIG and compiled the library with Di

Re: c++ extension, problem passing argument

2009-03-13 Thread Aaron Brady
On Mar 13, 12:03 pm, Matteo wrote: > Hi all, > > I wrote a few c++ classes for some data analysis on a physics > esperiment. Now I want to glue the lot with Python, so I built the > necessary wrap code with SWIG and compiled the library with Distutils. > All is fine, I can import the module and cl

c++ extension, problem passing argument

2009-03-13 Thread Matteo
Hi all, I wrote a few c++ classes for some data analysis on a physics esperiment. Now I want to glue the lot with Python, so I built the necessary wrap code with SWIG and compiled the library with Distutils. All is fine, I can import the module and classes work as expected... ...but for one thing

Re: C++ extension problem

2007-04-17 Thread Martin v. Löwis
> I assumed that the compiler would warn me about that kind of problem, > but I know better know. :) It's a variable argument list (...). The compiler is not supposed to give any warnings for that (although I do have a gcc patch that enables warnings for PyArg_ParseTuple). > Still, the error mess

Re: C++ extension problem

2007-04-17 Thread pythoncurious
On Apr 16, 11:44 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Now this is what confuses me: Why does it say that I have the wrong > > type when it's the same type as it suggests? > > When referring to the type, you must *always* form the address of the > type structure, including, but not l

Re: C++ extension problem

2007-04-17 Thread pythoncurious
On Apr 16, 9:31 pm, Michael Hoffman <[EMAIL PROTECTED]> wrote: > I can't answer your question since I have no experience > writingextensiontypes. I know this is at least partially a learning exercise > for you, but might I suggest that your time might be better spent > learning Boost.Python instea

Re: C++ extension problem

2007-04-16 Thread Martin v. Löwis
> Now this is what confuses me: Why does it say that I have the wrong > type when it's the same type as it suggests? When referring to the type, you must *always* form the address of the type structure, including, but not limited to, the line > if (!PyArg_ParseTuple(args, "O!", SillyStringTyp

Re: C++ extension problem

2007-04-16 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > I'm having a bit of trouble when writing a python extension. I can't > seem to figure out what I did wrong. > I tried to make a minimal example, but it's still quite a bit of > code. > It would be very appreciated if anyone could tell me what I've done > wrong. I can't

C++ extension problem

2007-04-16 Thread pythoncurious
Hi, I'm having a bit of trouble when writing a python extension. I can't seem to figure out what I did wrong. I tried to make a minimal example, but it's still quite a bit of code. It would be very appreciated if anyone could tell me what I've done wrong. First a short description of what I've do