Here is a real life example: I wrote a DLL in C for interacting with some special hardware to work. Then, at the first stage of testing, I wrote short C programs to make sure that different commands work correctly. The process of writing, compiling and starting was probably 3-5 times as long as I finally wrote the Python interface for the DLL using ctypes .
Now I can write test scripts much faster, without paying attention to the correct initialization of variables and memory management, which I would have to worry about in C. In fact, I could even use modular test libraries in Python to create much more reliable tests than before. Would it be possible in C? Absolutely, but it would take me a lot longer, and it would be much more lines of code.
Fewer lines of code in Python mean (in general) that in my core logic there are fewer things that could go wrong.
Moreover, since the hardware connection is almost completely tied to IO, there is no need to write any supporting code in C. I can also program in what is developing fastest.
So you go, a real example.
source share