2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 18:52:26 +00:00

Tutorials...

[SVN r15818]
This commit is contained in:
Joel de Guzman
2002-10-09 07:44:34 +00:00
parent e49e0d2705
commit a295ac6590
4 changed files with 302 additions and 6 deletions

15
example/tutorial/Jamfile Normal file
View File

@@ -0,0 +1,15 @@
# Hello World Example from the tutorial
# [Joel de Guzman 10/9/2002]
# Specify our location in the boost project hierarchy
subproject libs/python/example/tutorial ;
# Include definitions needed for Python modules
SEARCH on python.jam = $(BOOST_BUILD_PATH) ;
include python.jam ;
extension hello # Declare a Python extension called hello
: hello.cpp # source
<dll>../../build/boost_python # dependencies
;

View File

@@ -0,0 +1,17 @@
// Hello World Example from the tutorial
// [Joel de Guzman 10/9/2002]
char const* greet()
{
return "hello, world";
}
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
using namespace boost::python;
BOOST_PYTHON_MODULE(hello)
{
def("greet", greet);
}