如何编译一个Python包到一个dll [英] How to compile a Python package to a dll

查看:669
本文介绍了如何编译一个Python包到一个dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯,我有一个Python包。我需要将其编译为dll,然后分发它的方式很容易导入。 如何?您可以建议 *。pyc 。但我在某处读到任何 *。pyc 可以轻松反编译!



更新:
遵循这些:

1)我写了一个python包

2)想分发它

3)不要分发源代码< br>
4)* .pyc是可反编译的>>源可以提取!

5)dll是标准的

解决方案

写出你想隐藏在Cython中的所有内容,并将其编译为 pyd 。这就像你可以得到编译的python代码。



此外,dll不是一个标准,不是在Python世界。他们也不便携。


Well, I have a Python package. I need to compile it as dll before distribute it in a way easily importable. How? You may suggest that *.pyc. But I read somewhere any *.pyc can be easily decompiled!

Update: Follow these:
1) I wrote a python package
2) want to distribute it
3) do NOT want distribute the source
4) *.pyc is decompilable >> source can be extracted!
5) dll is standard

解决方案

Write everything you want to hide in Cython, and compile it to pyd. That's as close as you can get to making compiled python code.

Also, dll is not a standard, not in Python world. They're not portable, either.

这篇关于如何编译一个Python包到一个dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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