473,382 Members | 1,423 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,382 software developers and data experts.

Giving your C/C++ Application a Python Command Line...

Hi Folks,

I am building an application under multiple OS's, and I wanted to give
my application

For example, the test application I am working on is a calculator and I
would like to have a menu in the GUI option to open a command line
where you can use Python commands to perfom the functions of the
application within the Python command line. For example, if I wanted
to clear the display or display the about screen I would be able type
the command in the Python coimmand line. To do this I think I need to
embed Python in my application, and then expose my C/C++ functions to
Python.

I have read the documents on embedding Python and I can give my
application a command line, but I am having issues exposing my C/C++
functions to Python.

Does anyone know of any tutorials or example code that show how to do
this?

Thanks,

Andrew McCall

Apr 10 '06 #1
1 2358
On 10 Apr 2006 02:15:41 -0700, Andrew McCall <an***********@gmail.com> wrote:
Hi Folks,

I am building an application under multiple OS's, and I wanted to give
my application

For example, the test application I am working on is a calculator and I
would like to have a menu in the GUI option to open a command line
where you can use Python commands to perfom the functions of the
application within the Python command line. For example, if I wanted
to clear the display or display the about screen I would be able type
the command in the Python coimmand line. To do this I think I need to
embed Python in my application, and then expose my C/C++ functions to
Python.

I have read the documents on embedding Python and I can give my
application a command line, but I am having issues exposing my C/C++
functions to Python.

Does anyone know of any tutorials or example code that show how to do
this?
You have few choices:

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

PyCXX ( embedding only )
http://cxx.sourceforge.net/
Thanks,

Andrew McCall

--
http://mail.python.org/mailman/listinfo/python-list

--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
Apr 10 '06 #2

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

Similar topics

0
by: Adam | last post by:
Hi I had Ruby 1.6.8-8 for Windows installed on my WinXP Pro machine prior to installing Python 2.3. After installing Python 2.3, I tried to <----- screen output of python interactive command...
1
by: Gernot Hillier | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi! I'm the developer of a Linux ISDN application which uses embedded Python for controlling the communication. It starts several threads (i.e....
52
by: Olivier Scalbert | last post by:
Hello , What is the python way of doing this : perl -pi -e 's/string1/string2/' file ? Thanks Olivier
8
by: Jarek Zgoda | last post by:
What you consider a "best way to deploy linux python app"? I don't want to install library modules into user's site-packages, so distutils is no help. Currently, I change sys.path (adding directory...
0
by: Fuzzyman | last post by:
Movable Python has just been released on sourceforge. Movable Python is a frozen distribution of Python. It will run python scripts without needing to be installed. ...
15
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a...
18
by: stylecomputers | last post by:
Hi All, What do you find the best IDE for creating web applications in Python is? Preferably FOS IDE. Cheers
0
by: Martijn de Munnik | last post by:
Hi, I'm trying to build/install pysqlite on a Solaris 10 platform. I've got Sun Studio 11 on a AMD 64 platform and got this error. I'm a python newbie and just want to install trac. I've got...
0
by: Cameron Simpson | last post by:
On 17Aug2008 21:25, John Nagle <nagle@animats.comwrote: Because $HOSTNAME is a bash specific variable, set by bash but NOT EXPORTED! Like $0 and a bunch of other "private" variables, subprocesses...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.