import ctypes import os class HelloWorld: def __init__(self): # Obtener la ruta correcta al .so del submódulo self.lib_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'lib', 'build', 'lib', 'libhello.so') self.lib = ctypes.CDLL(self.lib_path) self.lib.hello.restype = ctypes.c_char_p def greet(self): return self.lib.hello().decode('utf-8')