部署python应用程序 [英] deploying python applications

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

问题描述

是否可以部署python应用程序,以使您不必发布源代码,也不必确保客户已安装python?

Is it possible to deploy python applications such that you don't release the source code and you don't have to be sure the customer has python installed?

我在想也许有些安装过程可以仅从.pyc文件和包含解释器或类似内容的共享库运行python应用程序?

I'm thinking maybe there is some installation process that can run a python app from just the .pyc files and a shared library containing the interpreter or something like that?

我渴望获得Python之类的语言的开发优势-高生产率等,但还不太了解如何将其专业地部署到不知道如何设置计算机的客户,而您肯定可以

Basically I'm keen to get the development benefits of a language like Python - high productivity etc. but can't quite see how you could deploy it professionally to a customer where you don't know how there machine is set up and you definitely can't deliver the source.

用python开发的专业软件公司如何做到这一点(或者答案可能是,他们不这样做)?

How do professional software houses developing in python do it (or maybe the answer is that they don't) ?

推荐答案


  1. 您可以合法地保护源代码,而不是技术上保护 em>。分发py文件确实没什么大不了的。

  1. You protect your source code legally, not technologically. Distributing py files really isn't a big deal. The only technological solution here is not to ship your program (which is really becoming more popular these days, as software is provided over the internet rather than fully installed locally more often.)

如果您不希望用户必须安装Python但想运行Python程序,则必须捆绑Python。您对这样做的抵触对我来说似乎很奇怪。 Java程序必须捆绑或预期JVM的存在。 C程序必须捆绑或预期libc的存在(通常是后者),等等。使用所需的东西并不容易。

If you don't want the user to have to have Python installed but want to run Python programs, you'll have to bundle Python. Your resistance to doing so seems quite odd to me. Java programs have to either bundle or anticipate the JVM's presence. C programs have to either bundle or anticipate libc's presence (usually the latter), etc. There's nothing hacky about using what you need.

专业的Python桌面软件包Python,可以通过py2exe / cx_Freeze之类的东西或内部相同的工具执行,也可以通过嵌入Python(在这种情况下,Python作为库而不是可执行文件提供)。前一种方法通常功能强大得多。

Professional Python desktop software bundles Python, either through something like py2exe/cx_Freeze/some in-house thing that does the same thing or through embedding Python (in which case Python comes along as a library rather than an executable). The former approach is usually a lot more powerful and robust.

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

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