This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/python/swig/__init__.py
Vitor Santoss Costa 3a06d4fecb win python support
2017-06-14 12:34:12 +01:00

25 lines
518 B
Python

import imp
import os
import ctypes
import glob
import os.path
import sys
import platform
global yap_lib_path
yap_lib_path = os.path.dirname(__file__)
if platform.system() == 'Windows':
def load( dll ):
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
dll = os.path.abspath(dll)
ctypes.WinDLL(dll)
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*')