Python网络服务...... [英] Python web service ...

查看:77
本文介绍了Python网络服务......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我已经完成了制作一个python程序,对bmp文件进行了一些

图像处理。

我现在想要将这个程序作为Web服务提供。用户可以访问

站点并通过Web界面将文件上传到web

服务器,然后服务器将使用python
程序我写过,当用户完成后必须得到图片

文件回来。


我的问题是设置一个可以运行的web服务器

python easy?我应该尝试ZOPE还是有更好的想法?

Hi folks, I have accomplished to make a python program that make some
image manipulation to bmp files.
I now want to provide this program as a web service. A user can visit a
site and through a web interface he should upload the file to the web
server , the server then will do the image process with the python
program I have wrote and when it finish the user must get the image
file back .

My question is how difficult is to set up a web server that can run
python easy ? should I try ZOPE or there is something better in mind ?

推荐答案

2006年8月26日04:07:35 -0700,< a href =mailto:ni ****** @ gmail.com> ni ****** @ gmail.com < ni ****** @ gmail.comwrote:
On 26 Aug 2006 04:07:35 -0700, ni******@gmail.com <ni******@gmail.comwrote:

大家好,我已经完成了一个python程序,可以对bmp文件进行一些

图像处理。

我现在想要将此程序作为Web服务提供。用户可以访问

站点并通过Web界面将文件上传到web

服务器,然后服务器将使用python
程序我写过,当用户完成后必须得到图片

文件回来。


我的问题是设置一个可以运行的web服务器

python easy?我应该尝试ZOPE还是有更好的东西?
Hi folks, I have accomplished to make a python program that make some
image manipulation to bmp files.
I now want to provide this program as a web service. A user can visit a
site and through a web interface he should upload the file to the web
server , the server then will do the image process with the python
program I have wrote and when it finish the user must get the image
file back .

My question is how difficult is to set up a web server that can run
python easy ? should I try ZOPE or there is something better in mind ?



对于一次性的东西,普通的旧CGI可能就足够了。你可以有一个带有上传表格的

静态HTML页面,让python执行

图像部分,并使用带有python的图像生成返回HTML />
脚本。如果你计划这么做,或者想要相当复杂的东西,或者下面的数据库访问,身份验证等,那么你可能会想要看看任何一个web framewoks。如果你没有网络已经处理好的服务器部分(例如,你已经拥有了Apache,并且已经运行了),那么Web服务器框架可以更多对于Web框架,在Python网站上有一个很长的列表。

哪种框架最适合你可能取决于你想要的

现在和将来都会完成。你可以尝试一些简单的东西和极简主义(以及你可以在不到一个下午阅读的文档)

如Karrigell,或者尝试更复杂的东西,比如Django ,

TurboGears,Pylons,CherryPy等。


然后,您可以尝试CGI方法开始,并作为您的

需要变得更加复杂,转向框架。 (这是我们自己的

路径:我们已经使用普通的CGI超过一年的时间用于我们开发的基于网络的生物信息学应用程序R和Python用于

计算,现在转向框架)。


祝你好运!


R 。


-

Ramon Diaz-Uriarte

生物信息学部门

西班牙国家癌症中心( CNIO)
http://ligarto.org/rdiaz


对于一次性的东西,普通的旧CGI可能就足够了。你可以有
For a one-shot thing, plain old CGI might be enough. You can have a

静态HTML页面,上传表格,让python做

图像部分,并生成返回HTML用python图像

脚本。如果你计划这么做,或者想要相当复杂的东西,或者下面的数据库访问,身份验证等,那么你可能会想要看看任何一个web framewoks。如果你没有网络已经处理好的服务器部分(例如,你已经拥有了Apache,并且已经运行了),那么Web服务器框架可以更多对于Web框架,在Python网站上有一个很长的列表。

哪种框架最适合你可能取决于你想要的

现在和将来都会完成。你可以尝试一些简单的东西和极简主义(以及你可以在不到一个下午阅读的文档)

如Karrigell,或者尝试更复杂的东西,比如Django ,

TurboGears,Pylons,CherryPy等。


然后,您可以尝试CGI方法开始,并作为您的

需要变得更加复杂,转向框架。 (这是我们自己的

路径:我们已经使用普通的CGI超过一年的时间用于我们开发的基于网络的生物信息学应用程序R和Python用于

计算,现在转向框架)。


祝你好运!


R 。


-

Ramon Diaz-Uriarte
static HTML page with the form for the upload, have python do the
image part, and generate the return HTML with the image with a python
script. If you plan to do this a lot, or want fairly sophisticated
stuff, or DB access underneath, authentication, etc, then you might
want to look at any of the web framewoks. If you don''t have the web
server part already taken care of (e.g., you already have Apache up
and running) then the web server framework can be more attractive.

As for web frameworks there is a long list in the Python web site.
Which framework fits you best might depend on what you want to
accomplish now and in the future. You can try something simple and
minimalist (and with docs that you can read in less than an afternoon)
such as Karrigell, or try something more complex, such as Django,
TurboGears, Pylons, CherryPy, etc.

And then, you might try the CGI approach to begin with, and as your
needs become more complex, move to a framework. (This has been our own
path: we''ve used plain CGI for over a year for the web-based
bioinformatics applications we''ve developed, that use R and Python for
computations, and are now moving to framework).

Good luck!

R.

--
Ramon Diaz-Uriarte



现在这个时候我更喜欢做一些最快的工作

可能...

我从未有过使用CGI的经验,我是否需要设置一个网络服务器
$ b这是$ b?

你能指点我一些有用的阅读资料,这样我就可以开始了吗?

我会在Zope上发表评论,我已经安装过一次这是非常容易的

。不知道我的工作是否也很容易......


Gracias Ramon。

At this time right now I prefer to do something that works the quickest
possible...
I never had any experience with CGI, do I need to set up a web server
for that ?
can you point me some usefull reading material so I can get a start ?
I will post for a comment at Zope , I had installed once and it was
very easy. Don''t know if it will be easy too to get my job done...

Gracias Ramon.


现在这个时候我更喜欢做一些最快的
At this time right now I prefer to do something that works the quickest

可能...

我从来没有任何经验使用CGI,我是否需要设置一个网络服务器



你能给我一些有用的阅读资料,这样我就可以开始吗?

我会在Zope上发表评论,我已经安装了一次,这很简单就是

。不知道完成我的工作是否也很容易...
possible...
I never had any experience with CGI, do I need to set up a web server
for that ?
can you point me some usefull reading material so I can get a start ?
I will post for a comment at Zope , I had installed once and it was
very easy. Don''t know if it will be easy too to get my job done...



如果你需要一个快速启动和简短的学习曲线,Karrigell就是

一个去。您可以在下载它的几分钟内运行您自己的网站/网络应用程序

的开头。


它现在有更好的CGI处理 - 如果你必须走这条路:)

www.karrigell.com


我也推荐Karrigell巡演,点击每个

示例旁边的图标,看看每个例子是如何编码的,并且它有一个文件上传示例

应该让你入门。

http://karrigell.no-ip.info/demo/frame_tour_en.htm


:)

If you need a quick-start and short learning curve, Karrigell is the
one to go for. You can have the beginnings of your own site/web-app
running within minutes of downloading it.

It now has better CGI handling too - if you must go that route :)

www.karrigell.com

I recommend the Karrigell tour also, click on the icon next to each
example to see how each one is coded, and it has a file upload example
that should get you started.

http://karrigell.no-ip.info/demo/frame_tour_en.htm

:)


这篇关于Python网络服务......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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