Skip to content

Instantly share code, notes, and snippets.

@matham
Created November 23, 2015 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matham/f6a07f8fb5e403feb440 to your computer and use it in GitHub Desktop.
Save matham/f6a07f8fb5e403feb440 to your computer and use it in GitHub Desktop.
import sys
from os.path import dirname, join, isdir
import ctypes
from ctypes import wintypes
# See https://github.com/numpy/numpy/wiki/windows-dll-notes#python-dlls
# and https://pytools.codeplex.com/workitem/1627
try:
_AddDllDirectory = ctypes.windll.kernel32.AddDllDirectory
_AddDllDirectory.argtypes = [wintypes.c_wchar_p]
# Needed to initialize AddDllDirectory modifications
ctypes.windll.kernel32.SetDefaultDllDirectories(0x1000)
except AttributeError:
_AddDllDirectory = ctypes.windll.kernel32.SetDllDirectoryW
_AddDllDirectory.argtypes = [wintypes.c_wchar_p]
_AddDllDirectory(sdl2\bin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment