In Defense of Taps (was Re: [Twisted-Python] where to begin)

Moshe Zadka m at moshez.org
Tue Feb 11 07:28:32 EST 2003


On 11 Feb 2003, William Dode <wilk-ml at flibuste.net> wrote:

> > '''
> > from twisted.web import server, static
> > from twisted.internet import reactor
> > 
> > root = static.Data("hello world", "text/plain")
> > root.putChild('', root)
> > # root.putChild('name-of-my-script', myScriptResource)
> > site = server.Site(root)
> > reactor.listenTCP(10998, root)
                             ^^^^ should have been "site", sorry"
> > reactor.run()
> > '''

> from twisted.internet import app
> from twisted.web import static, server, vhost, twcgi, script, trp
> 
> site = server.Site(resource)
> application = app.Application('web')
> application.listenTCP(10999, site)
> application.run()

why use Application if you're not interested in the benefits? Just use
plain reactor.

> > > I would like to make a web server that could be embed in an .exe with
> > > py2exe.
> > 
> > No, you wouldn't.
> 
> why ?

Because that huge .exe is unportable and would include all of Twisted
inside it. Wouldn't it be saner to just package Twisted with your application,
as well as Python, for those who want it, and let a smaller download, with
just your stuff, for those who can actually manage to do three clicks?
 
-- 
Moshe Zadka -- http://moshez.org/
Buffy: I don't like you hanging out with someone that... short.
Riley: Yeah, a lot of young people nowadays are experimenting with shortness.




More information about the Twisted-Python mailing list