C/C++ module vs python module. -


in python ( cpython) can import module: import module , module can *.py file ( python code) or module can module written in c/c++ ( extending python). so, such module compiled object file ( *.so/*.o on unix).

i know how executed interpreter exactly.

i think python module compiled bytecode , interpreted. in case of c/c++ module functions such module executed. so, jump address , start execution.

please correct me if wrong/ please more.

when import c extension, python uses platform's shared library loader load library , then, say, jumps function in library. can't load library or jump function way. works libs implemented support python , functions exported library python object. lib must understand python objects , use objects communicate.

alternately, instead of importing, can use foreign-function library ctypes load library , convert data c view of data make calls.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -