Dynamic image creation using Python over a web page
Question: I'm new to learning Python and I've been trying to implement a text to image
converter that runs on a web page.

  1. I have succeeded in making the functional code that converts the text into image in Python, using the PIL module (i.e., user enters input text at run time and that gets converted into an image and is stored in the hard drive).

  2. Now I want this code segment to work on a web page (something similar to feedback or comments form in websites).

a. That asks the user to enter a string in a text field and, on pressing a
button, it goes ahead and converts it into an image and reloads the page.

b. once reloaded it displays the string-converted-image, and also provides the
text box again for any new user to do the same.

  3. I started with the Google Web Apps framework, and unfortunately I learnt that Google Web Apps can't support PIL module although it provides an image API, it can't support dynamic image generations based on user input.

  4. So, can anyone guide me as to how I can go ahead and integrate a web page and the Python code that I have ready? So that it works?

  5. Please guide me where I need to look and anything you consider is necessary to know in order to proceed ahead.


Answer: Check out [webpy](http://webpy.org/), just about the simplest Python web
framework. In the web.py module, import your PIL image converter, grab the
text from the submitted form (via `web.input()`), convert the text and render
a page with the new image on it. You should be able to get a simple page up in
a dozen or so lines.

