Calling C Function Pointers from Python

Neil Hodgson neilh at scintilla.org
Sun Jul 30 08:39:24 EDT 2000


> Interesting -- it should be possible to create a similar module for
loading
> shared objects under UNIX and calling functions in those. Although it
wouldn't
> be that easy, since you would need to find a way to call a function
pointer
> with a variable number of arguments in C.

   A small piece of assembler is required in calldll to handle the low level
calling.

> Of course, such a module would hae to be part of the standard Python for
it to
> be really useful :)

   And then you'll run into opposition from people who think that this is
too dangerous. You can crash Python easily with

calldll.call_foreign_function(0,"l","l",(0,))

   Neil








More information about the Python-list mailing list