In Defense of Taps (was Re: [Twisted-Python] where to begin)
William Dode
wilk-ml at flibuste.net
Tue Feb 11 09:46:31 MST 2003
Moshe Zadka <m at moshez.org> writes:
> 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.
yes, i knew that it was possible...
>
> > > > 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?
Finaly, i try it with your little example, and it work, i can make one
.exe with py2exe. Not so big : 800ko (maybe we can write it on the FAQ
?)
It want to include tk, i don't know why, but i can remove it
after... It's enough to me to know that it's possible.
thanks again, it's up to me now to study more twisted.
--
William Dode - http://flibuste.net
More information about the Twisted-Python
mailing list