In other words, Jython allows Python to be both extended and embedded in Java,
much like the C integration strategies we’ve seen in this part of the book. By adding
a simpler scripting language to Java applications, Jython serves many of the same
roles as the C integration tools we’ve studied.
On the downside, Jython tends to lag behind CPython developments, and its re-
liance on Java class libraries and execution environments introduces Java depend-
encies that may be a factor in some Python-oriented development scenarios. Nev-
ertheless, Jython provides a remarkably seamless integration model and serves as
an ideal scripting language for Java applications. For more on Jython, check it out
online at http://www.jython.org and search the Web at large.
IronPython: C#/.NET integration
Also mentioned earlier, IronPython does for C#/.NET what Jython does for Java
(and in fact shares a common inventor)—it provides seamless integration between
Python code and software components written for the .NET framework, as well as
its Mono implementation on Linux. Like Jython, IronPython compiles Python
source code to the .NET system’s bytecode format and runs programs on the sys-
tem’s runtime engine. As a result, integration with external components is similarly
seamless. Also like Jython, the net effect is to turn Python into an easy-to-use
scripting language for C#/.NET-based applications and a general-purpose rapid
development tool that complements C#. For more details on IronPython, visit
http://www.ironpython.org or your friendly neighborhood search engine.
COM integration on Windows
COM defines a standard and language-neutral object model with which compo-
nents written in a variety of programming languages may integrate and commu-
nicate. Python’s PyWin32 Windows extension package allows Python programs
to implement both server and client in the COM interface model. As such, it pro-
vides an automated way to integrate Python programs with programs written in
other COM-aware languages such as Visual Basic. Python scripts can also use COM
calls to script Microsoft applications such as Word and Excel, because these sys-
tems register COM object interfaces. On the other hand, COM implies a level of
dispatch indirection overhead and is not as platform agnostic as other approaches
listed here. For more information on COM support and other Windows exten-
sions, see the Web and refer to O’Reilly’s Python Programming on Win32, by Mark
Hammond and Andy Robinson.
CORBA integration
There is also much open source support for using Python in the context of a
CORBA-based application. CORBA stands for the Common Object Request
Broker; it’s a language-neutral way to distribute systems among communicating
components, which speak through an object model architecture. As such, it rep-
resents another way to integrate Python components into a larger system. Python’s
CORBA support includes public domain systems such OmniORB. Like COM,
Other Integration Topics| 1539