Re: Embedding Python - How to create a class instance

2005-06-20 Thread Miki Tebeka
Hello Denis, >> I'm trying to embed Python in a C application. >> What I didn't find is how to create an instance once I have a class object. > > Class is a callable object. Just call it to create instance. > ... > obj = PyObject_CallObject(A, NULL); Thanks. After grepping the Python sources I

Re: Embedding Python - How to create a class instance

2005-06-20 Thread Denis S. Otkidach
On Sun, 19 Jun 2005 10:29:53 +0300 Miki Tebeka <[EMAIL PROTECTED]> wrote: > I'm trying to embed Python in a C application. > What I didn't find is how to create an instance once I have a class object. Class is a callable object. Just call it to create instance. > I'd like to do the equivalent o

Embedding Python - How to create a class instance

2005-06-19 Thread Miki Tebeka
Hello All, I'm trying to embed Python in a C application. What I didn't find is how to create an instance once I have a class object. I'd like to do the equivalent of: from a import A obj = A() obj.foo(10) The following code omits error checking for clarity. --- a.py --- class A: