bookwe called out to library through the extending api when our gui' user later clicked those buttonsthe gui library caught the event and routed it to our python functions with embedding although most of the details are hidden to python codecontrol jumps often and freely between languages in such systems python has an open and reentrant architecture that lets you mix languages arbitrarily for additional python/ integration examples beyond this booksee the python source code itselfits modules and objects directories are wealth of code resources most of the python built-ins we have used in this book--from simple things such as integers and strings to more advanced tools such as filessystem callstkinterand dbm files--are built with the same structures we'll introduce here their utilization of integration apis can be studied in python' source code distribution as models for extensions of your own in additionpython' extending and embedding and python/ api manuals are reasonably completeand provide supplemental information to the presentation here if you plan to do integrationyou should consider browsing these as next step for examplethe manuals go into additional details about extension typesc extensions in threaded programsand multiple interpreters in embedded programswhich we will largely bypass here extending python in coverview because python itself is coded in todaycompiled python extensions can be coded in any language that is compatible in terms of call stacks and linking that includes cbut also +with appropriate "extern cdeclarations (which are automatically provided in python header filesregardless of the implementation languagethe compiled python extensions language can take two formsc modules libraries of tools that look and feel like python module files to their clients types multiple instance objects that behave like standard built-in types and classes generallyc extension modules are used to implement flat function librariesand they wind up appearing as importable modules to python code (hence their namec extension types are used to code objects that generate multiple instancescarry perinstance state informationand may optionally support expression operators just like python classes extension types can do anything that built-in types and python-coded classes canmethod callsadditionindexingslicingand so on to make the interface workboth modules and types must provide layer of "gluecode that translates calls and data between the two languages this layer registers python/ integration