dynamic loading

This commit is contained in:
Vitor Santos Costa
2017-11-08 10:29:01 +01:00
parent 9100e797f8
commit 538cb4eb2c
15 changed files with 206 additions and 228 deletions

View File

@@ -6,8 +6,8 @@ import os.path
import platform
import sys
global yap_lib_path
yap_lib_path = os.path.dirname(__file__)
# global yap_lib_path
#yap_lib_path = os.path.dirname(__file__)
if platform.system() == 'Windows':
def load( dll ):
@@ -15,10 +15,10 @@ if platform.system() == 'Windows':
dll = os.path.abspath(dll)
ctypes.WinDLL(dll)
load('libYap*')
else:
def load( dll ):
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
dll = os.path.abspath(dll)
ctypes.CDLL(dll, mode=ctypes.RTLD_GLOBAL)
# else:
# def load( dll ):
# dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
# dll = os.path.abspath(dll)
# ctypes.CDLL(dll, mode=ctypes.RTLD_GLOBAL)
# load('libYap*')
# load('libPy4YAP*')