Can you recommend a well-structured Python module combining both compiled C code (e.g. using distutils) and interpreted source code? I gather that “packages” can roll up interpreted modules and compiled modules, but I’m at a loss if it’s possible to combine both compiled and interpreted sources into a single module. Does such a thing exist?
If not, is The Right Thing (TM) to have a package with from-import statements loading the public symbols from separated compiled and interpreted submodules?
You cannot have one module with both Python and C. Every .py file is a module, and C files are compiled and built into .so or .pyd files, each of which is a module. You can import the compiled module into the Python file and use them together.
If you want some ultra-simple examples, you might like A Whirlwind Excursion through Python C Extensions.