Hi Alain,
I notice you've looked at the Python example of stevemarple。
And I think you can refer to this part of code in __init__.py:
def init(library_file=None):
global zwolib
if zwolib is not None:
raise ZWO_Error('Library already initialized')
if library_file is None:
zwolib_filename = 'libASICamera2'
# You might expect ctypes.util.find_library() to be helpful here but it only returns the filename,
# not the path to the file (Linux, Python 2.7.9, ctypes 1.1.0). Expect user to find the library for us.
if sys.platform.startswith('linux'):
libpath = os.getenv('LD_LIBRARY_PATH')
ext = '.so'
elif sys.platform.startswith('darwin'): # Mac OS X
libpath = os.getenv('DYLD_LIBRARY_PATH')
ext = '.dylib'
else:
libpath = ext = None
if libpath:
for p in libpath.split(os.pathsep):
f = os.path.join(p, zwolib_filename + ext)
if os.path.exists(f):
library_file = f
break
........
zwolib = c.cdll.LoadLibrary(library_file)
In his code, this part is used to import SO. I think it should be useful.
Thanks
Chad