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

John Underwood johnbunderwood at yahoo.ca
Tue Apr 6 09:45:14 EDT 2004


On Mon, 5 Apr 2004 17:44:55 -0700, "Michael Geary"
<Mike at DeleteThis.Geary.com> wrote:

>John Underwood wrote:
>> I have both 2.2 and 2.3 installed on my computer. My problem has to do
>> with Visual Studio .NET which will build 2.3 but will not build 2.2.
>> (MS removed largeint.h which is required by pythoncore in 2.2 when
>> they went from Visual C++ 6 to VS.NET. I tried supplying largeint.h to
>> VS.NET but that did not work.)
>>
>> Since I cannot build 2.2, I do not have python22.dll or python22_d.dll
>> (the debug version). (They are not shipped with python you have to
>> produce them yourself.)
>
>The executable Python installer for Windows does install pythonXX.dll. You
>should find python22.dll and python23.dll in your Windows system32
>directory.
>
>Do you need python22_d.dll at all? I would think you'd need it only if you
>were actually debugging the Python interpreter itself. I've never needed a
>debug version of the Python DLL to debug ordinary Python code.
>
>> The commercial application to which I need to add an extension has
>> python22.dll in its runtime folder. I have no control over this
>> application and have to use whichever version they have chosen.
>
>Paint Shop Pro?

Curious Labs - Poser 5

>
>> 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)?
>
>Are you talking about source code compatibility only? Sure, as long as you
>use only language features available in both the old and new versions. You
>can't use .pyc bytecode files from one version with a different version.
>

Yes, although I'll have to check into the .pyc bytecode issue - which
I don't think is a problem.

>Anyway, I must be missing something here, because I would think you could
>simply develop with your installed Python 2.2 and run the code under your
>target application. You shouldn't have to be worrying about any of the stuff
>you're dealing with.
>

May be it comes down to the approach taken to debug an extension. (I'm
new to Python - as you've probably guessed - and debugging mixed
language situations.)

To use the dubugging features of Visual Studio to debug my extension
code, I thought I needed to use python22_d.dll (the debug version fo
python22.dll). Is this correct? If so, I have not been able to produce
it with Visual Studio .NET because of the problems VS has with 2.2.

On the other hand, would it be better to debug the extension without
the Python interface (in other words, debug the internals of the
extension that are not dependent on Python) before attempting to test
the Python interface (which could be performed with python22.dll)?

-John



More information about the Python-list mailing list