0%

macOS tips

macOS python load Framework

https://docs.python.org/3/library/ctypes.html

1
2
3
4
5
6
7
8
9
10
11
12
from ctypes.util import find_library
from ctypes import cdll
import os

print(os.name)
metal_library = find_library("Metal")
core_graphics_library = find_library("CoreGraphics")
mps_library = find_library("MetalPerformanceShaders")

print(cdll.LoadLibrary(metal_library))
print(cdll.LoadLibrary(core_graphics_library))
print(cdll.LoadLibrary(mps_library))