For those two languages in particular, this guide should have nearly everything you need to know:
https://docs.python.org/3.4/extending/index.html
As a rule of thumb, any good interpreted and/or VM-based language can:
- Have extension modules written in the same language as the interpreter.
- Allow you to embed the interpreter in other programs, again written in the language the interpreter / runtime was written in.
- Often, but not always, allow easily "wrapping" an existing native shared library.
This holds true for Java, Python, CLR languages, and Javascript, as well as some less commonly known languages that are typically used because they are easy to extend or embed (e.g. Lua and TCL).
Mixing & matching interpreted and/or compiled virtual machine based languages is often achievable by virtue of the fact that nearly every major language in this category has been re-implemented in every other one in addition to the often "standard" C impl of the languages.
For example, there's PyPy, Jython, and IronPython for Python.
And if all else fails, run two separate processes, one in each language, and use an IPC mechanism like sockets to talk between the two.