python calls extension module to register handlerstrigger events ######################################import cregister print('\ntest :'cregister sethandler(callback for in range( )cregister triggerevent(print('\ntest :'cregister sethandler(callback for in range( )cregister triggerevent(register callback function simulate events caught by layer routes these events to callback that' it--the python/ callback integration is set to go to kick off the systemrun the python scriptit registers one handler functionforces three events to be triggeredand then changes the event handler and does it again/pp /integrate/embed/registmake - makefile regist gcc cregister - - /usr/local/include/python -shared - /usr/local/bin -lpython - cregister dll /pp /integrate/embed/registpython register py test callback =spam number callback =spam number callback =spam number test callback =spamspamspam callback =spamspamspamspam callback =spamspamspamspamspam this output is printed by the event router functionbut its content is the return values of the handler functions in the python module actuallysomething pretty wild is going on under the hood when python forces an event to triggercontrol flows between languages like this from python to the event router function from the event router function to the python handler function back to the event router function (where the output is printed and finally back to the python script that iswe jump from python to to python and back again along the waycontrol passes through both extending and embedding interfaces when the python callback handler is runningtwo python levels are activeand one level in the middle luckilythis just workspython' api is reentrantso you don' need to be concerned about python/ integration