memcpy

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Sep 11 11:29:26 EDT 2007


On Tue, 11 Sep 2007 06:22:19 -0700, Tim wrote:

> Is this what you mean? Python did not like the word c_types in front
> of POINTER. Do you know why?

Yes I know.  Read up how importing works.

> How can I re-declare a function's return type if it is declared
> somewhere else?

The return type of C functions wrapped by `ctypes` is always `int` until
you say otherwise.  How to do that is covered in the `ctypes`
tutorial/dicumentation.

>         test_data = numpy.ones(1000)
>         shared_memory_pointer = POINTER(c_float*256)

This binds the resulting "pointer" object to the name
`shared_memory_pointer`.

>         shared_memory_pointer =
> windll.kernel32.MapViewOfFile(hMapObject, FILE_MAP_ALL_ACCESS,
>             0, 0, TABLE_SHMEMSIZE)

And here you bind a different object to that name, so the first binding
has no effect.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list