473,799 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1813
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 "communicat e"? 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*****@qualco mm.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

iD8DBQFDZxTW8jA dENsUuJsRAojWAK C8yh5IqyKWL7ekh IAHki9l3oM03wCe P2T9
bO8Zl5waTNLcOMI 7ooN9i5s=
=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
3116
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, which needs a Quicktime plugin, and one Java applet. He's also kindly supplied me with sample HTML code for each. The code looks like this (simplified):
3
5222
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# version=7,0,0,0" width="320" height="320"> <param name="src" value="file.dcr" /> <embed src="file.dcr" pluginspage="http://www.macromedia.com/go/getflashplayer" width="320" height="320"> </embed>
11
4499
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 that I've got confused. For example, what should be put into classid and codebase attributes of the OBJECT now embedding the EMBED tag?
2
5429
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 AUTOSTART="false"... In the good old days of Netscape 3 or so, just <A HREF="BWV659.mid">Musique</A> would open a small console in the active page itself, based on the plug-in selected by the user. Today, it opens
13
2321
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 current online users in a database, allowing a maximum of 5 users at one time. I have been looking through the php manual and came across session_cache_expire(). This isn't doing what I need either. Am I
1
2991
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 EMBED tag so I'm going to use some code to correct it but I can't tell which tag is responsible for the display. Andrew Poulos
6
2377
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"> <head> <titleMy title </title> </head> <body> on place un embed <embed id="embed1" alt="ne marche pas..." src="ws.php?
2
8093
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 did not understand some parameters totally in the HTML tag. These days when I was surfing the Internet I have found some comprehensive introduction to these two tags. I read it and conclude it with my own words; I think it will be useful to us, so I...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10252
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.