control language (what some call "macrolanguagealthough embedding is mostly presented in isolation herekeep in mind that python' integration support is best viewed as whole system' structure usually determines an appropriate integration approachc extensionsembedded code callsor both to wrap upthis concludes by discussing handful of alternative integration platforms such as jython and ironpythonwhich offer broad integration possibilities the embedding api the first thing you should know about python' embedded-call api is that it is less structured than the extension interfaces embedding python in may require bit more creativity on your part than extendingyou must pick tools from general collection of calls to implement the python integration instead of coding to boilerplate structure the upside of this loose structure is that programs can combine embedding calls and strategies to build up arbitrary integration architectures the lack of more rigid model for embedding is largely the result of less clear-cut goal when extending pythonthere is distinct separation for python and responsibilities and clear structure for the integration modules and types are required to fit the python module/type model by conforming to standard extension structures this makes the integration seamless for python clientsc extensions look like python objects and handle most of the work it also supports automation tools such as swig but when python is embeddedthe structure isn' as obviousbecause is the enclosing levelthere is no clear way to know what model the embedded python code should fit may want to run objects fetched from modulesstrings fetched from files or parsed out of documentsand so on instead of deciding what can and cannot dopython provides collection of general embedding interface toolswhich you use and structure according to your embedding goals most of these tools correspond to tools available to python programs table - lists some of the more common api calls used for embeddingas well as their python equivalents in generalif you can figure out how to accomplish your embedding goals in pure python codeyou can probably find api tools that achieve the same results table - common api functions api call python equivalent pyimport_importmodule import module__import__ pyimport_getmoduledict sys modules pymodule_getdict module __dict__ pydict_getitemstring dict[keypydict_setitemstring dict[key]=val pydict_new dict {embedding python in coverview