Jim,

You are helping me greatly!!!

I know how to **call** a C++ object from Python ...
just not how to **pass** the object from C++ to
Python.

So, how would I pass the following C++ object,
cPlotData, to Python?

struct sVec2
{
   int x;
   int y;
};

class cPlotData
{
public:
   int GetSize() { return mData.size(); }
   sVec2 Get(int i) { return mData.at(i); }
protected:
   std::deque< sVec2 > mData;
};

How should I pass an instance of this using Python/C
API?

I'm assuming you are referring to using these:
  PyObject_CallObject
  PyDict_GetItemString
  PyTuple_SetItem
Or, is there an easier way?

--- Jim Bublitz <[EMAIL PROTECTED]> wrote:
> On Thursday 19 May 2005 12:49, Niac Neb wrote:
> 
> Passing the plot data would depend on how much data
> there is - if it's a 
> really large amount, passing it via a file or pipe
> would seem to make sense. 
> Otherwise, it can be loaded into a Python structure
> (list, dict) using the 
> Python C API and passed as an arg to the function
> call.
> 


                
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html

_______________________________________________
PyKDE mailing list    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to