Summary
In this chapter we’ve seen the basics of what is involved with creating an interface between a Python program and an external device via a vendor-supplied DLL. Fortunately, adding functionality to Python is not necessarily a painful process; it just requires some up-front planning. This means that reading the available documentation on designing and implementing Python extensions is really not optional, which is why this chapter is peppered with URLs to sources of information.
Reading and understanding the API for a foreign DLL is also essential. When creating a wrapper extension for an existing DLL, the biggest obstacle one typically encounters is the API for the DLL. Occasionally it will be necessary to contact the vendor directly and request some technical support. Be forewarned, however, that many vendors either don’t have a clue about Python or don’t want to be bothered with it, so you may need to invest some time experimenting to find the best approach for creating a working interface.
With what we’ve covered here, you should be able to see where you want to go from where you are, and have a general idea about how to get there. In Chapter 14 we’ll see a working extension wrapper for real hardware using ctypes, and we’ll fill in more of the details in the process.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access