473,587 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python web service ...

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 ?

Aug 26 '06 #1
14 3014
On 26 Aug 2006 04:07:35 -0700, ni******@gmail. com <ni******@gmail .comwrote:
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 ?
For a one-shot thing, plain old CGI might be enough. You can have a
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
Bioinformatics Unit
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz
Aug 26 '06 #2
For a one-shot thing, plain old CGI might be enough. You can have a
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
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.

Aug 26 '06 #3
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...
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

:)
Aug 26 '06 #4

Tim Williams wrote:
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...

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

:)
I second Karrigell on simplicity. Zope despite recent improvements,
still has a steep learning curve.

Aug 26 '06 #5
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 ?
Just install Apache and run Python as CGI thats the best solution I
found for my apps. Thats the best and faster way to move python apps on
web.

Aug 26 '06 #6
On 26 Aug 2006 09:12:50 -0700, NicolasG <ni******@gmail .comwrote:
For a one-shot thing, plain old CGI might be enough. You can have a
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

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 ?
Yes, you'd need to configure a web server. I don't know whether you
are on windows or Unix/Linux, and that could seriously affect how easy
it is to set up a web server. Most Linux distros make installing
apache a piece of cake, but configuring Apache might not be trivial.

Thus, maybe the fastest and easiest is, as other posters have
suggested, to try Karrigell.

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...
But Zope seems to have a steep learning curve and it is a big system.
It might be a huge hassle for what you want.

Best,

R.
Aug 26 '06 #7

ni******@gmail. com wrote:
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 ?
I also second the suggestion of using Karrigell.
It comes with its own built-in server, and the task would be as simle
as writing the script and starting the server.

If performance and scalability is an issue, you could try mod_python,
which is an Apache module for running python, but this would require
installing and configuring Apache and mod_python separately.

luis

Aug 27 '06 #8
ni******@gmail. com a écrit :
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 ?
Unless you have other compelling reasons to use Zope, you would be
better IMHO with either CGI, apache+mod_pyth on, or a standalone Python
web server like CherryPy.

Aug 28 '06 #9
On 26 Aug 2006 04:07:35 -0700, ni******@gmail. com <ni******@gmail .comwrote:
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 ?
is that webservice or webserver?
if webservice try ZSI of it's a webserver why don't you try CherryPy?
>
--
http://mail.python.org/mailman/listinfo/python-list
Aug 28 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1542
by: Nazgul | last post by:
Hi! Sorry if I posted it twice... I need your help... I have the following problem. I've implemented the python Windows Service which behaves like a log supervisor. If the space used by log files is bigger than a given upper limit, then it starts to delete log files until the space is less than a given lower limit. I configured the service...
0
1455
by: David Mitchell | last post by:
Hello group, I'm trying to create a TCP server using Python, and I want it to run under Windows as a service. Now, I'm fine with building the TCP server using Python - done it lots of times, and I know there's lots of sample code out there I can grab if I ever need to. Equally, I think I've got the simpler concepts about creating...
3
5193
by: David Fraser | last post by:
Hi We are trying to debug a problem with services created using py2exe. It seems that these problems have arisen after services were installed and removed a few times. OK, first the actual problem we're seeing. After compiling a service with py2exe, running "service -install" and attempting to start it from the Services dialog, it pops...
0
1262
by: Saravanan | last post by:
Hello, Im using Python 2.3.3 along with Win32all (163). Currently my python application runs as Windows Service. Im using Win32all Service Framework to run the Python Code as a Windows Service. The following error has been reported to event viewer sparadically. "Reporting queued error: faulting application PythonService.exe, version...
3
2597
by: zxo102 | last post by:
Hi there, I have a python application (many python scripts) and I start the application like this python myServer.py start in window. It is running in dos window. Now I would like to put it in background as NT service. I got a example code: SmallestService.py from chapter 18 of the book "Python Programming On Win32" by Mark Hammond etc....
22
2597
by: flit | last post by:
Hello All, I have a hard question, every time I look for this answer its get out from the technical domain and goes on in the moral/social domain. First, I live in third world with bad gov., bad education, bad police and a lot of taxes and bills to pay, and yes I live in a democratic "state" (corrupt, but democratic). So please, don't try...
1
3025
by: Aspersieman | last post by:
Hi All I have a windows service (attached file). I basically just calls another script every 60 seconds. I can install, start and stop this service as expected with: ParseMailboxService.py install | start | stop The problem is: if I create an exe of this script (all required modules are included in the exe) with gui2exe (a frontend to...
3
1134
by: David Moss | last post by:
Hopefully a service like this already exists and I just haven't found it yet. If not it could be an idea for some kind soul(s) to pick up and run with ;-) As someone who writes and releases Python modules for the community, I find it difficult to have a decent level of confidence in the efficacy of my code on platforms and Python versions...
2
2639
by: Gabriel Rossetti | last post by:
Hello everyone, I'm trying to use python's freeze utility but I'm running into problems. I called it like this : python /usr/share/doc/python2.5/examples/Tools/freeze/freeze.py ~/Documents/Code/Python/src/jester/service.py -m jester then I did : make
2
1863
by: Guilherme Polo | last post by:
On 10/29/08, Zix <saviourms@yahoo.co.inwrote: Why did you decide to "expose" a web service through xmlrpc instead of actually exposing it by using a restful web service ? The links pointed by the previous email should help you, but well, I'm still surprised on this decision specially because you said you read a lot about this topic.
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.