Cython代码可以编译为
cython hello.pyx -o hello.c
gcc -shared -fPIC hello.c -o hello.so `pkg-config python --libs --cflags`
但是,如果您将上面的hello.so
更改为hello2.so
,则由于假设函数inithello2
将存在于python模块hello2.so
中,该模块将无法在python中导入。使用distutils,可以使用关键字setup(name='hello2',…)更改名称。但是我需要在不使用distutils的情况下获得这个功能。能做到吗?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐