可以编译使用cherrypy构建的独立Web应用程序吗? [英] Can a standalone web application built with cherrypy be compiled?

查看:43
本文介绍了可以编译使用cherrypy构建的独立Web应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想构建一个完全独立的Web应用程序,不需要apache.cherrypy是一个好的解决方案,可以用py2exe之类的东西编译吗?

I want to build a web application that stands completely by itself, apache not required. Is cherrypy a good solution, and can this be compiled with something like py2exe?

推荐答案

Python是一种脚本语言,通常不进行编译.您正在谈论的是将脚本打包到一个exe文件中(通过p2exe),并与相关模块和一个解释器捆绑在一起.

Python is a scripting language and is not usually compiled. What you are talking about is packaging your scripts into an exe (via p2exe), bundled with the relative modules and an interpreter.

许多脚本(包括CherryPy)都可以做到这一点,因为p2exe基本上将所有脚本放在一个地方,然后用解释器执行.此链接将使您可以将应用程序构建为exe.不过,我建议您使用 pyinstaller 代替,因为我发现它要容易得多.

This is possible with many scripts, including CherryPy, as p2exe basically sticks all your scripts together in one place, then executes it with the interpreter. This link will allow you to build your application into an exe. I would however recommend that you use pyinstaller instead, as I have found it to be much easier.

问题显示您可以守护CherryPy,并且可以从CherryPy页面->

This question shows that you can daemonize CherryPy, and from the page of CherryPy ->

您的CherryPy支持的Web应用程序实际上是独立的Python嵌入自己的应用程序多线程Web服务器.你可以将它们部署到可以运行的任何位置Python应用程序.阿帕奇不是必填

Your CherryPy powered web applications are in fact stand-alone Python applications embedding their own multi-threaded web server. You can deploy them anywhere you can run Python applications. Apache is not required

是的,您可以部署没有Apache的自包含的CherryPy.CherryPy似乎是一个很好的解决方案.

So yes you can deploy CherryPy, self-contained without Apache. CherryPy seems to be a fine solution.

这篇关于可以编译使用cherrypy构建的独立Web应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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