Using python23 to develop an extension for an application that has python22 embedded

Andrew MacIntyre andymac at bullseye.apana.org.au
Tue Apr 6 08:02:49 EDT 2004


On Mon, 5 Apr 2004, John Underwood wrote:

> Since I do have python23.dll and python23_d.dll (from a successful
> build of 2.3), can I use these to develop an extension for the
> aforementioned commercial application if I stay away from any new
> features in 2.3 (but not in 2.2)?

You can do the development, but you won't be able to directly distribute
the resulting extension because it will have been linked with python23.dll
when it needs to be linked with python22.dll.

To make things easier to fudge later, you make sure that your extension is
Distutils'ified from the beginning.

You can then use another compiler supported by the Distutils (MS CL
non-optimising compiler, MinGW, Borland etc) to build the distributable
extension in either a Python 2.2 or 2.3 installation, without risking
mixing C runtime library mismatches (VS.NET uses a different CRT than
VS6 I understand).  If using a 2.3 installation, you'll need to substitute
a 2.2 import library when building the final distributable version.

The Distutils setup.py script can then provide the installation harness.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen  ACT  2616
Web:    http://www.andymac.org/               |        Australia




More information about the Python-list mailing list