M
Martin Landa
Hi,
is it possible to pass pointer to a method using ctypes. Sample code:
...
G_set_error_routine(byref(self._print_error))
...
def _print_error(self, msg, type):
"""!Redirect stderr"""
self.log.write(msg)
gives me
G_set_error_routine(byref(self._print_error))
TypeError: byref() argument must be a ctypes instance, not
'instancemethod'
C function G_set_error_routine is defined as
void G_set_error_routine(int (*error_routine) (const char *, int))
Thanks in advance for any pointers. Martin
is it possible to pass pointer to a method using ctypes. Sample code:
...
G_set_error_routine(byref(self._print_error))
...
def _print_error(self, msg, type):
"""!Redirect stderr"""
self.log.write(msg)
gives me
G_set_error_routine(byref(self._print_error))
TypeError: byref() argument must be a ctypes instance, not
'instancemethod'
C function G_set_error_routine is defined as
void G_set_error_routine(int (*error_routine) (const char *, int))
Thanks in advance for any pointers. Martin