Re: How to create an instance of a python class from C++

2014-03-12 Thread Stefan Behnel
Barry Scott, 11.03.2014 22:37: > On 5 Mar 2014, at 00:14, Bill wrote: >> I can't figure out how to create an instance >> of a python class from 'C++': > > Why not use pycxx from http://sourceforge.net/projects/cxx/? > > This lib does all the heavy lifting for you for both python2 and python3. > H

Re: How to create an instance of a python class from C++

2014-03-11 Thread Barry Scott
On 5 Mar 2014, at 00:14, Bill wrote: > Hello: > > I can't figure out how to create an instance > of a python class from 'C++': > Why not use pycxx from http://sourceforge.net/projects/cxx/? This lib does all the heavy lifting for you for both python2 and python3. Has docs and examples. Barry

Re: How to create an instance of a python class from C++

2014-03-05 Thread Gene Heskett
On Wednesday 05 March 2014 17:09:53 Grant Edwards did opine: > On 2014-03-05, Alister wrote: > >>> Why are you creating an ABC? > >> > >> Because it was the first binary computer that did calculations with > >> electronic switching elements (gates), and it would be really cool to > >> have one!

Re: How to create an instance of a python class from C++

2014-03-05 Thread Grant Edwards
On 2014-03-05, Alister wrote: >> >>> Why are you creating an ABC? >> >> Because it was the first binary computer that did calculations with >> electronic switching elements (gates), and it would be really cool to >> have one! The ABC also pioneered the use of capciators as regenerative >> storage

Re: How to create an instance of a python class from C++

2014-03-05 Thread Alister
On Wed, 05 Mar 2014 16:08:00 +, Grant Edwards wrote: > On 2014-03-05, Ian Kelly wrote: >> On Tue, Mar 4, 2014 at 5:14 PM, Bill wrote: >>> Hello: >>> >>> I can't figure out how to create an instance of a python class from >>> 'C++': >>> >>> ( I am relatively new to Python so excuse some of th

Re: How to create an instance of a python class from C++

2014-03-05 Thread Grant Edwards
On 2014-03-05, Ian Kelly wrote: > On Tue, Mar 4, 2014 at 5:14 PM, Bill wrote: >> Hello: >> >> I can't figure out how to create an instance >> of a python class from 'C++': >> >> ( I am relatively new to Python so excuse some of the following. ) >> >> In a .py file I create an ABC and then special

Re: How to create an instance of a python class from C++

2014-03-05 Thread Bill
> > So far, so good. The object that was passed in was the "Derived" > class object. Since you presumably only want class objects to be > passed in, you might want to check that here using PyType_Check. > Yes. Will do. > > > PyTypeObject *typ = class_decl->ob_type; > > In Python, y

Re: How to create an instance of a python class from C++

2014-03-04 Thread Ian Kelly
On Tue, Mar 4, 2014 at 5:14 PM, Bill wrote: > Hello: > > I can't figure out how to create an instance > of a python class from 'C++': > > ( I am relatively new to Python so excuse some of > the following. ) > > In a .py file I create an ABC and then specialize it: Why are you creating an ABC?