[C++-sig] How to create an arbitary Python Object from C/C++

Terry Barnaby terry at beam.demon.co.uk
Wed May 1 18:10:18 CEST 2002


I am trying to create a Python wrapper for a C++ class.
Most of this is working, but I am stumped on how to create an arbitary Python Object
of a Python user defined class.

I can create a Python object from a C++ class definition with "PyObject_New()", but
how do I create a Python object of class "PyRect" whoose definition and implemnation
is in Python ?

I cannot find this in any of the C/C++ interface documentation.

Any help would be appreciated.


  Dr Terry Barnaby                     BEAM Ltd
  Phone: +44 1454 324512               Northavon Business Center, Dean Rd
  Fax:   +44 1454 313172               Yate, Bristol, BS37 5NH, UK
  Email: terry at beam.demon.co.uk        Web: www.beam.demon.co.uk
  BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software Dev
                         "Tandems are twice the fun !"

More information about the Cplusplus-sig mailing list