[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/elmopl/python/develop/src/import.cpp [Back]  [Original]

// Copyright Stefan Seefeld 2005.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include 
#include 
#include 
#include 

namespace boost 
{ 
namespace python 
{

object BOOST_PYTHON_DECL import(str name)
{
  // should be 'char const *' but older python versions don't use 'const' yet.
  char *n = python::extract(name);
  python::handle module(PyImport_ImportModule(n));
  return python::object(module);
}

}  // namespace boost::python
}  // namespace boost

Web Proxy Viewer  |  New URL  |  Original Page