[Tutor] How to create web interface?

Walter Prins wprins at gmail.com
Wed May 21 00:27:42 CEST 2014


Hi,

On 20 May 2014 21:00, P McCombs <mccombs at imperium.org> wrote:
> On May 14, Danny Yoo wrote:
>> > Another option might be to turn your program into a web site, so that
>> > the interface is the web browser, which everyone is getting used to
>> > these days.  But this, too, is also... involved.  :P
>
> I have a little volunteer scheduling application I've written as a
> module, with about a dozen functions, that reads and writes to a
> Sqlite database. I'd like to run a web server on my machine just for
> my local use.
>
> I don't understand how precisely the web page would communicate with
> the python program.
>
> If anyone has a suggestion on specific modules, and tutorials to use
> to create a web interface for a python program, I'd love to hear it.

You might want to work through this:
http://pythonpaste.org/do-it-yourself-framework.html
Or this, a newer version: http://docs.webob.org/en/latest/do-it-yourself.html
(but it contains a lot more detail and a lot more advanced Python concepts...)

Alternatively you can have a look at one of the many small and micro
web frameworks available for Python, e.g web2py, flask, bottle,
cherrypy etc. Links:
http://www.web2py.com/ (tutorial:
http://mherman.org/blog/2012/11/27/crash-course-in-web2py-part-1/#.U3vVpvldVSk
also: http://web2py.com/books/default/chapter/29/01/introduction)
http://flask.pocoo.org/ (tutorial:
http://flask.pocoo.org/docs/tutorial/ also:
http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
)
http://bottlepy.org/docs/dev/index.html (tutorial:
http://bottlepy.org/docs/dev/tutorial.html)
http://www.cherrypy.org/ (tutorial:
http://docs.cherrypy.org/en/latest/tutorial/index.html)

Cherrypy is perhaps a nice one for you to start with.

Hope that helps!

Walter


More information about the Tutor mailing list