I have the following problem. Any help would be appreciated :)
I am trying to call a C function from Python using ctypes. I have been successful in sharing the shared library (.dll on Windows with MS Visual Studio 2017) to Python 3.6.3.
There is a problem when I try to call the following function:
__declspec(dllexport) void printFunc()
{
printf("hello world !!");
//fflush(stdout);
}
I would like to see the output at Python interpreter as 'hello world !!' when I execute
mydll = cdll.LoadLibrary('path\\to\\sharedLibrary.dll')
mydll.printFunc.restype = None
mydll.printFunc()
Currently I see no output (because, the restype is None) when I execute the above code.
Expected output at Python interpreter after running the script:
>>> hello world !!
Any ideas please ??