You can dynamically compile & execute C/C++ code within your Python scripts
with weave.
Short example of use:
doc@mainframe:~> python2p3
Python 2p3 (#1, Nov 19 2003, 22:40:23)
[GCC 2.95.3 20010315 (release) (NetBSD nb3)] on netbsd1
Type "help", "copyright", "credits" or "license" for more information.
>>> import weave
>>> weave.inline('puts("C/C++ is teh sux0r, so we put it inside Python scripts");')
C/C++ is teh sux0r, so we put it inside Python scripts
>>>