By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,621 Members | 1,101 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,621 IT Pros & Developers. It's quick & easy.

Embedding Python in C++

P: n/a
Hi
i'm a italian student.
I must create a virtual machine which call python script from Visual C++
program.
My teacher tell me use swig fror make this work.
I use Swig for import in Python class, object, variables of C++, but my
problem are when in C++ i must call script Python.
I find many article, but i don't find a working example.
Can you advise me how i call python script from C++?
Have you example which can you send me (in my email)?
(my script use only int, float, string and object, class).
Thanks.
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ciao,

I have some examples from my PyCon presentation here:

http://elmer.sourceforge.net/PyCon04/elmer_pycon04.html

...and here is the complete example code:

http://elmer.sourceforge.net/PyCon04/Elmer_PyCon04.tgz

I think the example code from example 1 may be most relevant. You
can also use Elmer (http://elmer.sourceforge.net) to generate a C
interface to your Python code (as shown in examples 2 & 3).

Buona fortuna!
Rick.

Tonio wrote:
Hi
i'm a italian student.
I must create a virtual machine which call python script from Visual C++
program.
My teacher tell me use swig fror make this work.
I use Swig for import in Python class, object, variables of C++, but my
problem are when in C++ i must call script Python.
I find many article, but i don't find a working example.
Can you advise me how i call python script from C++?
Have you example which can you send me (in my email)?
(my script use only int, float, string and object, class).
Thanks.


Jul 18 '05 #2

P: n/a
( sending it again )

Hello,
I need to read newly generated uuid from Python
but I am not sure if
http://aspn.activestate.com/ASPN/Coo.../Recipe/163604

is the right code

Maybe there is already the library in Python 2.3

Maybe I can use the one generated with
uuidgen
under cygwin
but this would not be portable

In this last case I would like to know how can I capture the output of
uuidgen
so I can use it in my script

Thank you if you know the answer !

Cheers,
Marcello

Jul 18 '05 #3

P: n/a
Hi Marcello,
Maybe there is already the library in Python 2.3


I believe the OSAFoundation has something like an UUID generator for
Python in C. http://osafoundation.org/

I'm afraid you've to download Chandler to get it.

HTH,
Lars
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.