Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10161

Re: compiling qt app extensions with distutils

Date 2011-07-23 02:30 +0200
From Thomas Jollans <t@jollybox.de>
Subject Re: compiling qt app extensions with distutils
References <562586f4-d1cd-4bce-af50-fefdbb2ef0f9@h7g2000prf.googlegroups.com> <mailman.1365.1311344946.1164.python-list@python.org> <acf9108a-3b97-40e5-92ee-3c59345d6ea6@d8g2000prf.googlegroups.com> <mailman.1380.1311360188.1164.python-list@python.org> <e6fb9db1-0671-45cb-aa82-00cc1999aa5b@f17g2000prf.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1396.1311381051.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 22/07/11 21:37, strattonbrazil wrote:
>> Okay, your terminology was confused: you want to extend Python, not your
>> application.
> 
> Sorry, after I sent that e-mail, I realized I had already mixed up the
> terms, where I should have written "embedding".
> 
>> First of all, you don't technically need distutils: an extension module
>> is simply a shared library that you can build like any other library,
>> and I'm sure your build system can easily handle that. Then, you can
>> probably use bits of distutils to figure out where to install things to.
> 
> Hrmm, this seems like the most practical solution for me right now.
> It makes sense to embed python in my application like I originally
> planned, where I expose the individual functions I want to expose.
> Eventually if I actually want to provide the exposed functions as a
> library, I could actually just compile the application to a shared
> library instead of an executable (just not using the main function).
> The bindings in the C++ code are the same, correct?  Only the way
> they're built seems different.

There's no difference between using C and C++. Obviously, you always
need the correct extern "C" declarations, but IIRC, Python's method
definition macros handle that.

You could convert your whole application to a Python extension module,
expose the main function to Python, and launch the program using a small
Python wrapper script. (Or you could embed Python in your application.)

> 
>> Lastly, depending on what your goals are, you might want to consider not
>> integrating Python with your application at all, but exposing what
>> functionality you want to expose to Python via dbus. You could write a
>> skeleton module that exposes dbus proxy objects to Python scripts /
>> modules to make life easier.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

compiling qt app extensions with distutils strattonbrazil <strattonbrazil@gmail.com> - 2011-07-22 06:43 -0700
  Re: compiling qt app extensions with distutils Thomas Jollans <t@jollybox.de> - 2011-07-22 16:29 +0200
    Re: compiling qt app extensions with distutils strattonbrazil <strattonbrazil@gmail.com> - 2011-07-22 09:22 -0700
      Re: compiling qt app extensions with distutils Thomas Jollans <t@jollybox.de> - 2011-07-22 20:43 +0200
        Re: compiling qt app extensions with distutils strattonbrazil <strattonbrazil@gmail.com> - 2011-07-22 12:37 -0700
          Re: compiling qt app extensions with distutils Thomas Jollans <t@jollybox.de> - 2011-07-23 02:30 +0200

csiph-web