PyImport_AppendInittab doesn't work with package and sub-module (Python 3.4)
24 Jul
2014
24 Jul
'14
7:10 a.m.
I have a C++ application that I swigged to Python 2.7. I'm currently trying to port my code from Python 2.7 to Python 3.4 using the Python/C API and SWIG.
I have a package containing multiple modules. The problem is I cannot find a way to initialize my module *ModuleABC* as a sub-module of package *PackageXYZ*. It works well with Python 2.7 but not with Python 3.4 (and I suppose it wouldn't work either with any Python 3.x version). This code works:
PyImport_AppendInittab("ABC", PyInit__ABC);Py_Initialize();PyImport_ImportModule("import ABC");
But not this one:
PyImport_AppendInittab("packageXYZ.ABC", PyInit__ABC);Py_Initialize();PyImport_ImportModule("import packageXYZ.ABC");
Any idea?
-- *Olivier*
3706
Age (days ago)
3706
Last active (days ago)
0 comments
1 participants
participants (1)
-
Olivier Voyer