<br><br><div class="gmail_quote">On Wed, Oct 29, 2008 at 6:51 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><a href="mailto:dudeja.rajat@gmail.com" target="_blank">dudeja.rajat@gmail.com</a> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I've a dll and its header file that controls an hardware. I want to write a wrapper for this dll in Python.<br>
What is the best way that I can write a wrapper?<br>
</blockquote>
<br></div>
What do you want to do with the wrapper?</blockquote><div><br>I'm intending to use STAF - software testing automation framework where I want to test this dll. Test cases for STAF are written in xml and python. So for this I want to write a wrapper class for this dll in python that has Dll API's as the member function of the wrapper class.<br>
<br>This class will be in a python module. This module can be then be imported in the test cases thereby exposing the dll APIs for testing.<br><br>Please suggest if there are better solutions around.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I know ctypes modules and have used it before. As far as I know ctypes is only used to call the dll functions in a python module.<br>
</blockquote>
<br></div>
I am not sure what you mean here. Python code can directly import and call functions in dlls that represent Python extension modules and that are placed in the Pythonxx/dlls directory in your Windows Python installation. Ctypes is mostly used to call functions in a dll that is *not* a python extension module, that was not written for Python.<br>
<font color="#888888">
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div>Well I did not know this. What is a Python extension module?<br clear="all"><br><br><br>-- <br>Regrads,<br>Rajat<br>