如何部署Python桌面应用程序? [英] How do I deploy a Python desktop application?

查看:730
本文介绍了如何部署Python桌面应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始在桌面上运行的个人python应用程序。我正在使用wxPython作为GUI工具包。如果需要这种类型的应用程序,我可能想将其商业化。



我不知道部署现实生活的Python应用程序,尽管我过去使用了 py2exe ,取得了不同的成功。我如何模糊代码?我可以以某种方式部署字节码吗?



一个理想的解决方案不会危及我的知识产权(源代码),不需要直接安装Python(虽然我是确定需要一些嵌入式解释器),并且将是跨平台的(Windows,Mac和Linux)。有没有人知道这方面的任何工具或资源?



谢谢。

解决方案>

您可以分发编译的Python字节码(.pyc文件)而不是源代码。您无法防止Python(或任何其他语言,真的)中的反编译。您可以使用像 pyobfuscate 这样的混淆器,使其对竞争对手更为恼人解密您的反编译源码。



正如Alex Martelli所说在这个线程中,如果你想让你的代码保密,你不应该在别人的机器上运行。



IIRC,最后一次使用 cx_Freeze 时,它为Windows创建了一个DLL这消除了本机Python安装的必要性。这至少值得一试。


I have started on a personal python application that runs on the desktop. I am using wxPython as a GUI toolkit. Should there be a demand for this type of application, I would possibly like to commercialize it.

I have no knowledge of deploying "real-life" Python applications, though I have used py2exe in the past with varied success. How would I obfuscate the code? Can I somehow deploy only the bytecode?

An ideal solution would not jeopardize my intellectual property (source code), would not require a direct installation of Python (though I'm sure it will need to have some embedded interpreter), and would be cross-platform (Windows, Mac, and Linux). Does anyone know of any tools or resources in this area?

Thanks.

解决方案

You can distribute the compiled Python bytecode (.pyc files) instead of the source. You can't prevent decompilation in Python (or any other language, really). You could use an obfuscator like pyobfuscate to make it more annoying for competitors to decipher your decompiled source.

As Alex Martelli says in this thread, if you want to keep your code a secret, you shouldn't run it on other people's machines.

IIRC, the last time I used cx_Freeze it created a DLL for Windows that removed the necessity for a native Python installation. This is at least worth checking out.

这篇关于如何部署Python桌面应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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