Commit d89eb2a3 authored by Georg Brandl's avatar Georg Brandl

Fix inconsistent function name in embedding howto.

parent cb8b792c
...@@ -155,13 +155,13 @@ for data conversion between Python and C, and for error reporting. The ...@@ -155,13 +155,13 @@ for data conversion between Python and C, and for error reporting. The
interesting part with respect to embedding Python starts with :: interesting part with respect to embedding Python starts with ::
Py_Initialize(); Py_Initialize();
pName = PyString_FromString(argv[1]); pName = PyUnicode_FromString(argv[1]);
/* Error checking of pName left out */ /* Error checking of pName left out */
pModule = PyImport_Import(pName); pModule = PyImport_Import(pName);
After initializing the interpreter, the script is loaded using After initializing the interpreter, the script is loaded using
:c:func:`PyImport_Import`. This routine needs a Python string as its argument, :c:func:`PyImport_Import`. This routine needs a Python string as its argument,
which is constructed using the :c:func:`PyString_FromString` data conversion which is constructed using the :c:func:`PyUnicode_FromString` data conversion
routine. :: routine. ::
pFunc = PyObject_GetAttrString(pModule, argv[2]); pFunc = PyObject_GetAttrString(pModule, argv[2]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment