cython安装ubuntu_ubuntu上的Cython独立可执行文件
I want my cython program to be standalone executable on linux, not to be imported. After
cython --embed
i got a c file,now how can i make it executable?
解決方案
I guess you have to compile the .c file you have obtained.
Assuming you are using python 3.5 and don't have to link to other libraries than python you can do this with a simple gcc command like :
gcc -I /usr/include/python3.5m -o your_program your_file.c -lpython3.5m
(you might need to remove the m following the version number)
As you expect it will use the if __name__ == "__main__": statement as entry-point of the program.
總結(jié)
以上是生活随笔為你收集整理的cython安装ubuntu_ubuntu上的Cython独立可执行文件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 离心机工作原理动态图(离心机工作原理)
- 下一篇: servlet多重映射_关于多重映射问题