Ziga Seilnacht wrote:
> The second example uses your approach and is a bit more cumbersome,
> but still works. Could you post your current version of the code?
> I don't understand where your problem could be.
I think, there's no need to. Now I understand :)
> if (!PyArg_ParseTuple(args, "O
zefciu wrote:
> Ok. Now I do it this way:
>
> c_real = PyFloat_AsDouble(PyTuple_GetItem(coord,0));
> c_imag = PyFloat_AsDouble(PyTuple_GetItem(coord,1));
>
> And it worked... once. The problem is really funny - in the interactive
> the function fails every second time.
>
> >>> mandelpixel((1.5, 1
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
zefciu wrote:
> Thinker wrote:
>
>> Since PyArg_ParseTuple() is supposed to parse arguments, I
>> recommand you to use PyTuple_GetItem() or PyTuple_GET_ITEM().
>
> Ok. Now I do it this way:
>
> c_real = PyFloat_AsDouble(PyTuple_GetItem(coord,0)); c_ima
Thinker wrote:
> Since PyArg_ParseTuple() is supposed to parse arguments, I recommand you
> to use PyTuple_GetItem() or PyTuple_GET_ITEM().
Ok. Now I do it this way:
c_real = PyFloat_AsDouble(PyTuple_GetItem(coord,0));
c_imag = PyFloat_AsDouble(PyTuple_GetItem(coord,1));
And it worked... once.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
zefciu wrote:
> Thinker wrote:
>
>> You can add some printf() to throw out messages to make sure
>> where the program stop at. If you can compile the module with
>> debug information and use gdb to backtrace dump file, it would be
>> useful.
>
> Did it
Thinker wrote:
> You can add some printf() to throw out messages to make sure where the
> program stop at.
> If you can compile the module with debug information and use gdb to
> backtrace dump file,
> it would be useful.
Did it. The arguments are parsed, but the coord tuple isn't. But can
PyAr
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
zefciu wrote:
> Thinker wrote:
>
>> It should be "PyObject *coord;" . Maybe, it is what is wrong with
>> your program!
>>
>>
> Should it? The gcc shows me a warning then:
>
> warning: 'coord' is used uninitialized in this function
>
> and during the ex
Thinker wrote:
> It should be "PyObject *coord;" .
> Maybe, it is what is wrong with your program!
>
>
Should it? The gcc shows me a warning then:
warning: 'coord' is used uninitialized in this function
and during the execution I get the same error *plus* a segfault.
zefciu
--
http://mail.py
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
zefciu wrote:
> I am trying to embed a c function in my python script for a first
> time. When I try to call it I get an error
>
> SystemError: new style getargs format but argument is not a tuple
>
> Guido said on some mailin
Thinker wrote:
> zefciu wrote:
>>> I am trying to embed a c function in my python script for a first
>>> time. When I try to call it I get an error
>>>
>>> SystemError: new style getargs format but argument is not a tuple
>>>
>>> Guido sa
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
zefciu wrote:
> I am trying to embed a c function in my python script for a first
> time. When I try to call it I get an error
>
> SystemError: new style getargs format but argument is not a tuple
>
> Guido said on some mailin
I am trying to embed a c function in my python script for a first time.
When I try to call it I get an error
SystemError: new style getargs format but argument is not a tuple
Guido said on some mailing list, that it is probably an effect of the
lack of METH_VARARGS in the functions' array
12 matches
Mail list logo