Calling DLL function in Python
Question: I am having trouble understanding on how to call dll functions from an
existing dll in Python.

    
    
    OTAClient = cdll.LoadLibrary("C:\PATH\OTAClient.dll")
    connect = OTAClientDLL.TDConnection()
    

* * *
    
    
    exceptions.AttributeError: function 'TDConnection' not found                
    

I read something the name being mangled by the compiler. Any suggestions?


Answer: The DLL was actually a COM DLL. comtypes is needed to use this type of DLL
instead of ctypes. Make sure to [download
comtypes](http://sourceforge.net/projects/comtypes/files/)

    
    
    from comtypes.client import CreateObject
    
    OTAClientDLL = comtypes.client.GetModule("C:\PATH\OTAClient.dll")
    

