On 30.10.2012, at 20:50, Oliver Tonnhofer wrote:
> On 30.10.2012, at 19:43, Sean Gillies wrote:
> 
>> Yes, but then we'd still have to CDLL the right DLL? I'm not sure what
>> that is and won't be able to test it.
> 
> ctypes uses the PATH environment on Windows when loading libraries (similar 
> to LD_LIBRARY_PATH on Unix). So it should work, but I can verify that 
> tomorrow.

It all works as expected:

>>> from ctypes import CDLL, c_char_p
>>> CDLL('geos.dll')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
>>> import os
>>> os.environ['PATH'] += ';z:\\path\\to\\geos'
>>> CDLL('geos.dll')
<CDLL 'geos.dll', handle 6bf80000 at 1765250>
>>> geos = CDLL('geos.dll')
>>> geos.GEOSversion.restype = c_char_p
>>> geos.GEOSversion()
'3.3.5-CAPI-1.7.5'
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to