473,842 Members | 1,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Basic Boost.Python Question

Hi,

I have been working in getting Boost.Python running on my PC, seems to
work now.
I have what I believe is somewhat of basic question here.
I am starting on an application that will developed in VS2005, probably
using C++/CLI.
I want to be able to exchange data in between Python and C++. The user
when running the C++ app will be able to call a python script, set
some values, that will then be communicated to running application, it
will have to run the python code, and send some data to the
applicationfrom Python to vary the performance. And probably the C++
end will have to call a python script and pass some data to it.
So, is Boost.Python the way to go here or is there something else that
will accomplish this?

Thanks for your help
Jeff

Aug 14 '06 #1
4 2155
Hoop wrote:
Hi,

I have been working in getting Boost.Python running on my PC, seems to
work now.
I have what I believe is somewhat of basic question here.
I am starting on an application that will developed in VS2005, probably
using C++/CLI.
I want to be able to exchange data in between Python and C++. The user
when running the C++ app will be able to call a python script, set
some values, that will then be communicated to running application, it
will have to run the python code, and send some data to the
applicationfrom Python to vary the performance. And probably the C++
end will have to call a python script and pass some data to it.
So, is Boost.Python the way to go here or is there something else that
will accomplish this?
Boost.Python is certainly a (good) way to do it ! I go as far as
including a Python shell to allow two-way interactions with the objects
loaded in the C++ GUI of my app ... Look at the tutorial, mostly here:

http://www.boost.org/libs/python/doc...embedding.html

To know how to use Python from a C++ application. But I warn you: it is
much simpler the other way around, i.e. having a Python app' calling
some C++ code to make some parts quicker (or call already existing libs).

Pierre
>
Thanks for your help
Jeff
Aug 14 '06 #2
Hoop:
I am starting on an application that will developed in VS2005, probably
using C++/CLI.
I haven't heard any reports of Boost.Python code being compatible
with C++/CLI so you may need to add an adaptation layer. To run inside
..NET, I'd choose IronPython.

Neil
Aug 14 '06 #3
Hi Neil,
I have never heard of IronPython. Do you know if you can embedd the
Python interpreter ?
Thanks
Jeff

Neil Hodgson wrote:
Hoop:
I am starting on an application that will developed in VS2005, probably
using C++/CLI.

I haven't heard any reports of Boost.Python code being compatible
with C++/CLI so you may need to add an adaptation layer. To run inside
.NET, I'd choose IronPython.

Neil
Aug 15 '06 #4
Hoop:
I have never heard of IronPython. Do you know if you can embedd the
Python interpreter ?
I think so as I've read of people embedding the console on the
mailing list. My experience is in using a C# library within a Python
application.

Neil
Aug 15 '06 #5

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

Similar topics

1
2197
by: Roy Smith | last post by:
Up until recently, Python was the only language I'd ever seen that used the % operator for string replacement. Today, I was perusing the C++ Boost libraries, and discoverd that boost::format uses a very similar syntax. The following lines print the same thing in Python and C++, respectively. print "int->%i, string->%s" % (42, "wugga, wugga") cout << boost::format ("int->%i, string->%s\n") % 42 % "wugga, wugga"; The question is,...
2
3104
by: Stephen Horne | last post by:
I started making up a Python extension module to wrap a C++ library of mine using Boost Python. Trouble is, the library has a number of classes each of which has a lot of methods. I seem to have hit an internal limit in the Visual C++ 7 compiler. The output I get is... """ ....found 2031 targets... ....updating 4 targets...
2
3061
by: Steve Knight | last post by:
Hello, I'm new to Boost & Python and I'm diving straight in by trying to write an extension module to a third party library. Foolishness probably, but I don't have much choice! My question is how can I write a C++ method that will either return a boost wrapped C++ class or a Python object type depending on some internal value?
0
1228
by: Gouda Man | last post by:
I'm planning to write a large program that will have advanced scripting in python in which the scripter will subclass c++ objects to add functionality. this leads me to boost.python (if you dont already know about boost.python dont bother reading farther cause its a kind of a technical question) anyways i embeded python in a litte c++ test app i wrote and got it working fine. eg: i could write a little python program and my app would load...
0
2135
by: Li Daobing | last post by:
I can't use .def(str(self)) I write a simple example, without `str', I can build it well, but with this one, I can't build //Rational.cpp #include <boost/python.hpp> #include <iostream> using namespace std; using namespace boost::python;
11
4930
by: Osiris | last post by:
I have these pieces of C-code (NOT C++ !!) I want to call from Python. I found Boost. I have MS Visual Studio 2005 with C++. is this the idea: I write the following C source file: ============================ #include <iostream> #include <stdafx.h>
0
1772
by: Osiris | last post by:
My experiences with BOOST on Windows XP and Visual C++ 2005 I'm new to Python. I built software in more than ten other computer languages. I'm not sure if that is not a handicap, when reading documentation of a system like BOOST. However: It took me more than four full working days to get a Python/C/C++ 'hello world!' program to work. There is a lot of documentation, but somehow it did not 'click' with my previous experience. I think...
0
1541
by: MarkE | last post by:
I'm just getting started on Boost Python and may have missed this obvious looking problem somewhere. Given a c-extension "testext" written using Boost Python containing a base class "Base", a derived class "Derived", and a function "doSomething" which expects a "Derived" parameter, if I pass it a "Base" parameter an exception is thrown. This is a Boost.Python.ArgumentError. My question is how do I catch this error ? I tried the...
0
4614
by: devito | last post by:
hi there, for some days i try to build the boost.python tutorial "hello world" without bjam on winxp by using mingw. so i wrote a *.bat-file like the following: // --- snip -------------------------------------------------------------------------------------- @echo off SETLOCAL
0
9871
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
9715
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,...
1
10672
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,...
0
10313
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5696
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5884
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4089
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3144
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.