top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

using 3rd party dll in python

0 votes
380 views

I would like to use the Gen3.dll functions from python. I understand that I can use ctypes to load the dll. I have been able to load the dll but cannot make any sense of how to use it once I have it loaded. I have been trying to understand the ctypes tutorial but I just can't wrap my head around it. I have attached a zip file of everything I have about the dll, including the Gen3.dll. Can someone point me in the right direction. My hopes are that I can automate the functions to provide a test program. The Gen3.dll communicates to a piece of hardware over a USB cable. Its mainly for setting voltages and loads and reading results.

posted Jun 26, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

ctypes basically gives you a way to access a DLL "as if from a C program" (to paraphrase the module name).

You'll have to understand how the DLL entry-points are used to be able to make sense of using it from ctypes. That is, if you can figure out how to use the DLL from VC++ or VB, then you use it the same way with ctypes (just wrap the parameters with ctypes "type" converters)

answer Jun 26, 2013 by anonymous
Similar Questions
0 votes

Im required to import ha certain dll called 'NHunspell.dll' which is used for Spell Checking purposes. I am using Python for the software. Although I checked out several websites to properly use ctypes, I have been unable to load the dll properly.

When I use this code.

 from ctypes import *
 hunspell = cdll.LoadLibrary['Hunspellx64.dll']

I get an error

 hunspell = cdll.LoadLibrary['Hunspellx64.dll']
 TypeError: 'instancemethod' object has no attribute '__getitem__'

I guess it might a problem with the structure of the dll. But I have no idea how to import the dll properly.

–1 vote

I'm working on a new project and i want to receive a request from a user and to redirect him to a third party site, but on the page after i redirect my users i want to them to see injected html (on the third party site.)

i'm not really sure how to approach this problem..

0 votes

I'm new to Python and trying to run a already written code. Can someone please explain the error below? And if possible, how do I resolve this?

Traceback (most recent call last):
 File "c:Project_1regression_1.py", line 7, in  from sklearn import metrics, cross_validation, linear_model
 File "c:Python27libsite-packagessklearnmetrics__init__.py", line 31, in from . import cluster
 File "c:Python27libsite-packagessklearnmetricscluster__init__.py", line 8, in 
 from .supervised import adjusted_mutual_info_score
 File "c:Python27libsite-packagessklearnmetricsclustersupervised.py", line 19, in 
 from .expected_mutual_info_fast import expected_mutual_information
 File "expected_mutual_info_fast.pyx", line 10, in init sklearn.metrics.cluster
.expected_mutual_info_fast (sklearnmetricsclusterexpected_mutual_info_fast.c: 4886)
 File "c:Python27libsite-packagesscipyspecial__init__.py", line 529, in <module>
 from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
+1 vote

When I run the code on my ID running from a windows 7 computer everything runs fine but when it is run on a different ID at night on the server it fails to finish.

A side question, is there a way of getting a log from a batch?

...