Hello people,
I'm having a similar issue. I started studying pyS60 extensions and wrote a simple one.
I generated the pyd.file and put it on the c:/sys/bin folder on the emulador. When I try to load it, I get a KErrNotSupported error.
I'm using Carbide.vs (MS Visual Studio) and here's the extension code:
Code:
#include "Python.h"
#include "symbian_python_ext_util.h"
/* module functions */
static PyObject *
message(PyObject *self, PyObject *args)
{
char *fromPython, result[64];
if (! PyArg_Parse(args, "(s)", &fromPython))
return NULL;
else {
strcpy(result, "Hello, ");
strcat(result, fromPython);
return Py_BuildValue("s", result);
}
}
static struct PyMethodDef test_methods[] = {
{"message", (PyCFunction)message, METH_NOARGS, NULL},
{NULL, NULL}
};
/* module initializer */
DL_EXPORT(void) inittest(void)
{
Py_InitModule("test", test_methods);
}
Here is the mmp file:
Code:
TARGET test.dll
TARGETTYPE dll
UID 0x1000008d 0xebe66aaf
SECUREID 0xebe66aaf
VENDORID 0
capability NONE
SYSTEMINCLUDE \epoc32\include\libc
SYSTEMINCLUDE \epoc32\include\python
USERINCLUDE ..\src
SYSTEMINCLUDE \epoc32\include
DOCUMENT bld.inf
DOCUMENT testmodule.pkg
SOURCEPATH ..\src
SOURCE testmodule.cpp
LIBRARY python222.lib
LIBRARY euser.lib
EXPORTUNFROZEN
Then, after the build I copy the .dll as _test.pyd to the sys/bin folder on the emulador.
My python script is simply, "import _test", then I get the error.
Am I missing something ?
Thanks