Python calling and using windows dllâs
<p>HelloI  have to ask 1 question about python and dll functions.  which I am a bit frustrated about.   The question is can I load dll functions from windows using python? I heard of Ctype to do that, but I canât find good tutorials for this  Is there another way to use dll files from windows to get extra functionality? I want to call some dll to work with mouse events  I used pyautogui but it is not that useful for me.   I wonder is python good for windows aplications? I know it runs on windows however there are good dll function that can provide better functionality for windows then python original libraries.  Well thatâs my opinion what I think anyways   Is it worth to work with dlls with python after all? Or I better study c# for that  Because I   love python for simplisity and donât  want to  move to c# yet.</p>

<p>Yes you can. The <code>ctypes</code> library is indeed what you need. The official doc is here <a href="https://docs.python.org/3/library/ctypes.html" rel="nofollow">https://docs.python.org/3/library/ctypes.html</a> . 
Loading DLLs pretty straightforward, but calling the functions inside can be a pain depending on the arguments types. Handling old C style error return codes is also cumbersome compared to the exception handling and general low overhead code style in Python.</p>

<p>99% of the time it is way easier and better to use an appropriate existing module that either implements what you need or wraps the appropriate DLL for you. For example search in PyPI which is the central repository of Python expternal modules. That's my advice.</p>

python windows dll dllimport