Skip to content

Instantly share code, notes, and snippets.

View LAK132's full-sized avatar
😭

lak LAK132

😭
View GitHub Profile
@LAK132
LAK132 / cimport.py
Last active July 30, 2018 09:05
PY_EXPORT
from sys import platform
from ctypes import cdll, CDLL
from ctypes import sizeof, c_void_p
def loadlibrary(name):
'''loads library "name[32/64/...][.dll/.so]" depending on platform'''
return CDLL((name+"{}{}").format(sizeof(c_void_p)*8, "" if platform=="win32" else ".so"))