Browser front-end, python back-end

Jeff Hinrichs jlh at cox.net
Tue Jan 28 16:13:09 EST 2003


twisted.
http://www.twistedmatrix.com/

I use it to build portable, lightweight, browser based apps.  Good success,
decent example code. More robust, IMO, than CGIHTTPserver.

example of killing the server from the browser:
#
# stop.rpy - kill a twisted web server
# $Id: stop.rpy 30 2003-01-04 05:58:27Z JeffH $
#
from twisted.web import resource
from twisted.internet import reactor
class myResource(resource.Resource):
    def render(self, request):
        reactor.stop()
        return ""

resource = myResource()

have fun!
-Jeff

"Eric Mattes" <ericmattes at yahoo.com> wrote in message
news:fd5aa35c.0301280922.a952dc7 at posting.google.com...
> Hi.
>
> I'd like to know if anyone knows a way to write a python program that
> can be interfaced with through a web browser. I've been investigating
> some GUIs and although I've written a prototype GUI in Tkinter, it
> lacks personality. I'd like to make a nice GUI using HTML. Has anyone
> done anything like this before? If so, how? Would it involve
> embedding/using BaseHTTPServer? Ideally this would run on both Windows
> and Mac OS.
>
> Any ideas? Thanks!
> -E






More information about the Python-list mailing list