You must pass a string.
For instance:
self.tesseract.TessTextRendererCreate('/path/to/output/file/without/extension')
Here is a generic example with the mock API. In lib.cc:
#include <iostream>
extern "C" {
const char * foo (const char * input) {
std::cout <<
"The function 'foo' was called with the following "
"input argument: '" << input << "'" << std::endl;
return input;
}
}
Compile a shared library using:
clang++ -fPIC -shared lib.cc -o lib.so
Then in Python:
>>> from ctypes import cdll, c_char_p
>>> lib = cdll.LoadLibrary('./lib.so')
>>> lib.foo.restype = c_char_p
>>> result = lib.foo('Hello world!')
The function 'foo' was called with the following input argument: 'Hello world!'
>>> result
'Hello world!'
source
share