简体   繁体   English

我可以将Cython与3rdparty纯python库一起使用吗?

[英]Could I use Cython with 3rdparty pure python library?

I'm using Python to develop a commercial software. 我正在使用Python开发商业软件。 But I don't want to offer source to my clients. 但是我不想向客户提供资源。

I knew that Cython can complie my code to binary. 我知道Cython可以将我的代码编译为二进制。

But could I use Cython with 3rdparty pure python library(I mean those libraries written in pure Python)? 但是我可以将Cython与3rdparty纯python库一起使用(我的意思是那些用纯Python编写的库)吗?

Cython compiles to .pyd (not pyc), which is basically a dll. Cython编译为.pyd(不是pyc),基本上是一个dll。 In theory it should work with any python code, including 3rd party libraries, but there's no guarantee (see the first comment below). 从理论上讲,它可以与任何Python代码一起使用,包括第3方库,但不能保证(请参阅下面的第一条评论)。 You'd also better check the licenses of the libraries you intend to use though, to make sure they don't prohibit distributing as closed source. 不过,您最好还是检查打算使用的库的许可证,以确保它们不禁止作为封闭源分发。

Your other option is something like cx_Freeze or py2exe , both of which I think compile to binary. 您的其他选项是cx_Freezepy2exe之类的东西,我认为它们都可以编译为二进制文件。 I've never really inspected the files they produce though so you'll need to check up on that. 尽管我从未真正检查过它们生成的文件,所以您需要进行检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM