Cython可以编译成EXE吗? [英] Can Cython compile to an EXE?

查看:1307
本文介绍了Cython可以编译成EXE吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Cythons的目的是什么。它是用Python类语言编写可编译的C扩展,以便在代码中产生加速。我想知道(而且似乎找不到使用我的google-fu)是如果Cython可以以某种方式编译成可执行格式,因为它已经似乎打破了python代码到C。

I know what Cythons purpose is. It's to write compilable C extensions in a Python-like language in order to produce speedups in your code. What I would like to know (and can't seem to find using my google-fu) is if Cython can somehow compile into an executable format since it already seems to break python code down into C.

我已经使用Py2Exe,它只是一个打包程序,但我有兴趣使用它编译下来的东西,有点难以解开(任何使用Py2EXE打包的东西基本上只能使用7zip解压缩不想要)

I already use Py2Exe, which is just a packager, but am interested in using this to compile down to something that is a little harder to unpack (Anything packed using Py2EXE can basically just be extracted using 7zip which I do not want)

似乎如果这不是可能我的下一个选择只是编译所有我的代码,并加载为一个模块然后打包使用py2exe至少得到我的代码到编译的形式,

It seems if this is not possible my next alternative would just be to compile all my code and load it as a module and then package that using py2exe at least getting most of my code into compiled form, right?

推荐答案

原则上,根据嵌入Pyrex,似乎有可能做你想要的东西HOWTO 。 (Pyrex实际上是上一代Cython。)

In principal it appears to be possible to do something like what you want, according to the Embedding Pyrex HOWTO. (Pyrex is effectively a previous generation of Cython.)

嗯...这个名字比我第一次尝试的更好:embedding cython导致此页面听起来像你想要的。

Hmm... that name suggests a better search than I first tried: "embedding cython" leads to this page which sounds like what you want.

这篇关于Cython可以编译成EXE吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆