I noticed that Python modules / packages have two types. Some of them are simply pure Python scripts and can be simply copied and pasted into the Python directory. Others, however, require, and I think, these are usually wrappers for or based on C / C ++ code, that the code is “built” and / or “compiled” using setup.py to create a set of new files.
My questions are about the second type of module / package. Why should they be compiled, is there a specific reason for this? Could the distributor simply provide all the files from the start?
The reason I ask is because I want to distribute such C ++-based packages as part of my own packages, so the user does not need to worry about installing dependencies on their own and not worry about compiling, etc. I always wondered why distributors of modules do not just include dependencies, and do not ask the user to install them themselves.
I suspect that the answer may be bc, that additional files must be written in a certain way depending on what type of OS is on the computer and whether it is 32 or 64 bits. Could this mean that the distribution of compiled files will work, but only if the user has the same specific OS and bit system as the one where the files were compiled.
In any case, it is curious to know the answer.
source
share