473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Forced to Embed?

Hi

After researching on Extending and Embedding it appears Extending is
favoured greatly over Embedding. I've tested Boost::Python successfully
in a test project but have run into an issue.

I have about 10 shared libraries that up until now have only been
statically linked into an application and used from C++. I'd like to
expose a lot of this functionality as different Python modules ( core,
network, input, etc ), however the interdependency between the libraries
seem to prohibit this. The library dependencies are in a tree heirarchy
with the basic core library at the bottom.

As far as I can tell I have to export these all in one massive module as
there is no way for the different python modules to directly communicate
with each other?

Because of this I have to assume any application specific code would
have to be placed in this massive module aswell and thus the whole
module setup is moot and I might aswell embed python in the application
and import the different interfaces as modules into the python namespace
while still having them communicate directly because they're in the same
executable.

I'd prefer to extend while using the normal python interpreter but I see
no way around this without a large restructure?

Thanks for any suggestions...
Nov 1 '05 #1
2 1792
Hello Lloyd,
I have about 10 shared libraries that up until now have only been
statically linked into an application and used from C++. I'd like to
expose a lot of this functionality as different Python modules ( core,
network, input, etc ), however the interdependency between the libraries
seem to prohibit this. The library dependencies are in a tree heirarchy
with the basic core library at the bottom.

As far as I can tell I have to export these all in one massive module as
there is no way for the different python modules to directly communicate
with each other? What do you mean by "communicate"? Whey isn't "import" good enough?

Because of this I have to assume any application specific code would
have to be placed in this massive module aswell and thus the whole
module setup is moot and I might aswell embed python in the application
and import the different interfaces as modules into the python namespace
while still having them communicate directly because they're in the same
executable.

I'd prefer to extend while using the normal python interpreter but I see
no way around this without a large restructure?

You can have one Python module that is the interface to the C++ module and
it will be structured the way you want (using classes, modules ...).

Bye.
--
------------------------------------------------------------------------
Miki Tebeka <mt*****@qualcomm.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: GnuPT 2.7.2

iD8DBQFDZxTW8jAdENsUuJsRAojWAKC8yh5IqyKWL7ekhIAHki 9l3oM03wCeP2T9
bO8Zl5waTNLcOMI7ooN9i5s=
=psvG
-----END PGP SIGNATURE-----

Nov 1 '05 #2
Lloyd wrote:
As far as I can tell I have to export these all in one massive module as
there is no way for the different python modules to directly communicate
with each other?


I don't see how this is a Python issue. If you can make these modules
into shared objects / dynamically linked libraries, and make a C++
application use them as such, you should be able to get this to work
even if the main program is a Python program that imports them via
a wrapper, right? Or is there something I missed? (I'm no expert in
writing extensions.)

I know that it's possible to mess up C/C++ code in such a way that
dynamic linking requires a major rewrite, but I don't see that this
has anything to do with Python except that you got two bright ideas
at the same time: Use Python as main and modularize the code better.

I guess you *should* pull up your sleeves and clean up your code, but
it's not always that we get the time to do what we should...
Nov 1 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wolfgang Schwanke | last post by:
Dear usenet, I'm having the following small problem. I've been ask to add some Quicktime panoramas to a website. The author of the panoramas has made two versions of each: One in MOV format,...
3
by: Tony Sutton | last post by:
I have this following code in my html file: <object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#...
11
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after...
2
by: François de Dardel | last post by:
Please don't scream that EMBED is evil ! What I am doing is <EMBED SRC="BWV659.mid" AUTOSTART="false" LOOP="TRUE" CONTROLS="SMALLCONSOLE" WIDTH="50" HEIGHT="15" TITLE="BWV 659"> Note the...
13
by: Mickey | last post by:
Hi all, Currently I use a timestamp to log users out after 15 minutes of inactivity. However I also need to log a user out if they have just left the page. I need to do this because I store...
1
by: Andrew Poulos | last post by:
With "normal" SWF HTML there's an EMBED tag nested within an OBJECT tag. How can I check which tag is actually displaying the SWF? I'm using CSS on them and the style on the OBJECT affects the...
6
by: qualitychecker | last post by:
Hello thanks for your help.. I try to reference a PHP module from within a HTML file, see below ---------------------------------------- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">...
2
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.