Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2007-07-09 13:35:39


on Mon Jul 09 2007, Lawrence Spector <Lawrence.Spector-AT-CanfieldSci.com> wrote:

> I created an example of code that demonstrates the error.

Lawrence,

I suggest:

1. You post your question to the C++-sig
   (http://boost.org/more/mailing_lists.htm#cplussig)

2. You include your code as an inline attachment, so that it doesn't
   come out with an extra blank line betwen every real line of
   code and wrap around in surprising ways:

> Here's what the code looks like, as of right now:
>
> PythonPassReference.cpp:
>
> boost::python::object pyTestClass(testClassWrapper);
>
> // Works: pyTestClass.attr("output")();
>
> {
>
> handle<> ignored((PyRun_String(
>
> // Works: "pyTestClass = PythonInterface.TestClass(6, 8.3, 'W')\n"
>
> "pyTestClass.output()\n" // Error unless the previous line is
> uncommented
>
> , Py_file_input
>
> , main_namespace.ptr()
>
> , main_namespace.ptr())
>
> ));

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
The Astoria Seminar ==> http://www.astoriaseminar.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net