Re: [C++-sig] export custom C++ exception to Python so it can beraisedby python

2012-11-06 Thread Giuseppe Corbelli
On 06/11/2012 15:35, Martin Hellmich wrote: I've based my code on. http://stackoverflow.com/questions/9620268/boost-python-custom-exception-class I have used the same reference and also this suggestion for including the other attributes shown here: http://stackoverflow.com/questions/11448735/bo

Re: [C++-sig] problem embedding python - very simple example

2012-11-06 Thread Stefan Seefeld
On 11/06/2012 02:40 PM, Cory Riddell wrote: > It prints "hello\nworld\n" then throws an exception executing the line > that creates the hello.txt file: > First-chance exception at 0x755ac41f in Test.exe: Microsoft C++ > exception: boost::python::error_already_set at memory location 0x0039fb60.. >

Re: [C++-sig] problem embedding python - very simple example

2012-11-06 Thread Cory Riddell
Argh! I didn't notice that the example code I was trying was using file() rather than open(). Sheeesh. After correcting this, I was able to get it to work successfully! Step one on the thousand mile journey is complete! Cory On 11/6/2012 1:40 PM, Cory Riddell wrote: > I downloaded and installed

[C++-sig] problem embedding python - very simple example

2012-11-06 Thread Cory Riddell
I downloaded and installed the 32-bit version of Python 3.3. I downloaded and compiled boost-1.52.0. I've been able to build and run the tutorial Python extension but haven't been able to get anything but the most trivial example of embedding to work. My code (which compiles with no warnings):

Re: [C++-sig] export custom C++ exception to Python so it can be raisedby python

2012-11-06 Thread Martin Hellmich
Hi Giuseppe, On 11/06/2012 10:08 AM, Giuseppe Corbelli wrote: On 05/11/2012 18:51, Martin Hellmich wrote: Hi, I have a custom exception in C++ that I would like to use in Python. Let's call it MyException with custom constructor and members (an implementation is below). I would like to expose

[C++-sig] how to boost.build using two different python versions

2012-11-06 Thread Ronny Herzog
Dear all, I need to cross compile a python extension using boost.build. I have Python 2.6 (32 and 64 Bit) and Python 2.7 (64 Bit) installed on my computer. I compiled boost with Python 2.6 (32Bit). My goal is to compile the python extension for Python 2.7 (64Bit). The problem is that it does

Re: [C++-sig] export custom C++ exception to Python so it can be raisedby python

2012-11-06 Thread Giuseppe Corbelli
On 05/11/2012 18:51, Martin Hellmich wrote: Hi, I have a custom exception in C++ that I would like to use in Python. Let's call it MyException with custom constructor and members (an implementation is below). I would like to expose it to python so that I can raise it: > raise MyException(-1,