How to build Boost.Python

2006-01-23 Thread Andrew Ayre
Hi, I can't seem to get the library built, and any help is greatly
appreciated. Here is the info:

Windows XP
Borland C++ Builder 5
Latest Boost source code (downloaded at the weekend)
Windows binary bjam 3.1.11

Command line:

bjam "-sTOOLS=borland" "--with-python-root=C:\Python" "--with-python"
install

Result:


C:\Boost\boost_1_33_1>bjam "-sTOOLS=borland" "--with-python-root=C:\Python"
"--with-python" install
**
Building Boost.Iostreams with bzip2 support disabled.
To enable bzip2, consult the Boost.Iostreams documentation
**
**
Building Boost.Iostreams with zlib and gzip support disabled.
To enable zlib and gzip, consult the Boost.Iostreams documentation
**
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(and if you don't know what ICU is then you probably don't need it).
 skipping build of <@boost!libs!python!build>boost_python.dll; toolset=
borland variant= debug 
 skipping build of <@boost!libs!python!build>boost_python.dll; toolset=
borland variant= debug 
 skipping build of <@boost!libs!python!build>boost_python.dll; toolset=
borland variant= release 
 skipping build of <@boost!libs!python!build>boost_python.dll; toolset=
borland variant= release 
 skipping build of <@boost!libs!python!build>libboost_python.lib;
toolset= borland variant= debug 
 skipping build of <@boost!libs!python!build>libboost_python.lib;
toolset= borland variant= debug 
 skipping build of <@boost!libs!python!build>libboost_python.lib;
toolset= borland variant= release 
 skipping build of <@boost!libs!python!build>libboost_python.lib;
toolset= borland variant= release 
...found 6900 targets...

regards,
Andy
[EMAIL PROTECTED] (remove year to reply - please reply to newsgroup
though)



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


Executing script with embedded python

2006-01-25 Thread Andrew Ayre
Hi, I have a script that I want to execute from C. I don't want to call any
functions, just execute the script. Below is a code snippet.

The problem is that PyObject_CallObject always returns NULL. Is this the
correct return value for simply executing a script, as there is no function
return value involved?

  // load script
  pname = PyString_FromString(SCRIPTFILENAME);
  pmodule = PyImport_Import(pname);
  Py_DECREF(pname);

  if (pmodule != NULL)
  {
// execute script
presult = PyObject_CallObject(pmodule, NULL);
if (presult == NULL)
{
  Py_DECREF(pmodule);
  return;
}
Py_DECREF(presult);
Py_DECREF(pmodule);
  }
  else
  {
return;
  }


regards, Andy
[EMAIL PROTECTED] (remove year to reply)


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


Re: Executing script with embedded python

2006-01-26 Thread Andrew Ayre

"Farshid Lashkari" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > The problem is that PyObject_CallObject always returns NULL. Is this the
> > correct return value for simply executing a script, as there is no
function
> > return value involved?
>
> The documentation for PyObject_CallObject states the following:
>
> "Returns the result of the call on success, or NULL on failure".
>
> So it seems like the call is failing. My guess would be that modules are
> not callable objects. Also, this seems somewhat redundant since your
> module is effectively executed when you import it using the
> PyImport_Import function.
>
> -Farshid
>

Thanks for the reply. The script does execute and do what I want it to do,
without any problems. The only problem is that I get the NULL result. So I
think it is callable.

Andy



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


Re: Executing script with embedded python

2006-01-26 Thread Andrew Ayre

"Farshid Lashkari" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > The problem is that PyObject_CallObject always returns NULL. Is this the
> > correct return value for simply executing a script, as there is no
function
> > return value involved?
>
> The documentation for PyObject_CallObject states the following:
>
> "Returns the result of the call on success, or NULL on failure".
>
> So it seems like the call is failing. My guess would be that modules are
> not callable objects. Also, this seems somewhat redundant since your
> module is effectively executed when you import it using the
> PyImport_Import function.
>
> -Farshid
>

I redirected stderr to my application and it is reporting that "module" is
not callable. Pretty odd, considering it is executing the script anyway.
I'll look into this further. Thanks.

Andy



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


Re: Executing script with embedded python

2006-01-26 Thread Andrew Ayre

"Farshid Lashkari" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > The problem is that PyObject_CallObject always returns NULL. Is this the
> > correct return value for simply executing a script, as there is no
function
> > return value involved?
>
> The documentation for PyObject_CallObject states the following:
>
> "Returns the result of the call on success, or NULL on failure".
>
> So it seems like the call is failing. My guess would be that modules are
> not callable objects. Also, this seems somewhat redundant since your
> module is effectively executed when you import it using the
> PyImport_Import function.
>
> -Farshid
>

Yes, you were 100% correct. Thanks!

Andy


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