views:

25

answers:

2

I have created a Python Program that converts strings into images at run time , using PIL's Image Draw module.

I want to run this program interfaced with a simple web form that should display a text field to input the string and on pressing a button , it should display the string converted as an image.

Would be a great deal of help if one could precisely guide me as to how i can go about and achieve this ?

PS:I have downloaded the Python Web Module as of now and im currently exploring it, just in case that helps.

+1  A: 

I would suggest using web.py from http://webpy.org/. It is an excellent micro-framework for doing simple or one-off web apps.

Do your image creator write files or return streams? Anyway, web.py can return both files and stream large files to the browser. See http://webpy.org/images for an example on how to set headers based on content type.

If you are planning on writing a larger web app, maybe you should look into Turbogears, Pylons or Django.

knutin
@knutin Thanks for the guidance, im checking webpy now. What my program does is it takes a string entered by the user and makes an image with the string superimposed on it. for this i need PIL's Image module to work
Arun Ramakrishnan
PIL will work within every framework or server I can think of. The important question is how you deliver the image to the browser. web.py allows you to write files to disk which it will then happily serve up itself or you can use a "real" webserver, like apache or nginx. It even allows you to send a stream from PIL to the browser, if you for example get a io buffer from PIL.
knutin