[Twisted-Python] Re: Teach Me Twisted?

alex clemesha clemesha at gmail.com
Wed Jan 23 20:18:26 EST 2008

On Jan 23, 2008 4:36 PM, <glyph at divmod.com> wrote:

> On 12:10 am, clemesha at gmail.com wrote:
> >Thanks Steve Holden for organizing this, it's a great idea.
> Indeed!
> >Some nice topics might include:
> Thanks for the suggestions.  Do you have any others?  :-)

For my usage of twisted, these are important to me and I am
the most familiar with them. (See below)

I hate to
> rain on your parade here, but I think maybe my explanation of why I
> don't like these suggestions will spark discussion of more different
> ones...
> >a) Start off simple with a "twisted.web2" example (everyone "gets"
> >http)
> I think that this is actually something we should avoid in a tutorial.
> The web situation in Twisted is complicated
> (http://twistedmatrix.com/trac/wiki/WebDevelopmentWithTwisted).  web2 in
> particular is suffering from an extreme lack of maintenance and still
> has never "officially" been released; work is just starting to get
> underway to unify t.web2 and nevow into t.web and reduce the confusion,
> but this is all still in progress and who knows when, how, or even if it
> will be completed.

Oh yes, I know, I know.  While learning twisted I read *most* (that's alot
of posts to the twisted-web mailing list.  So I am very familiar with the

That said, oh how I wish you guys could make twisted.web2 the one and
It would be good for beginners and others alike.

Note however: I can only barely imagine how hard that might be,
so I am *definitely not* complaining ... Twisted is excellent, thanks very
much for it.

If you get a group of experienced Twisted folks
> together to talk about writing web applications, you're more likely to
> spark a debate than an educational session.
> Even if all these problems were fixed, and there were a really good,
> well-supported, universally understood web server for Twisted, the
> benefits of Twisted's programming model are not immediately obvious to
> the bread and butter of the web programming world.  Learning how to use
> some combination of Twisted tools to generate a web page will always be
> at least a little bit harder than writing the sort of glorified CGI
> script that most web frameworks require these days - unless you're using
> something like Athena, which might be too much complexity to address in
> a single tutorial session.  (And while Athena is more polished and "one
> right way" than the lower-level HTTP stuff, there is still a painful
> dearth of documentation, not to mention the fact that you need to write
> JavaScript as well as Python.)

"Comet" (aka what Athena does) is one of my main uses of twisted, see


is some code that I use.

That and other ajax-y stuff.  Not much templating html, etc.

> Twisted really shines best when you're writing a client as well as a
> server.  Chat is the quintessential application where Twisted makes the
> most sense - and the lack of a well-documented chat server is much less
> of a problem than the lack of a well-documented web server, since you
> can easily define a wire protocol and wacky semantics for your purpose-
> built tutorial chat application.


> >b) then plug that into a simple sqlite database using
> >"twisted.enterprise"
> twisted.enterprise is similarly a scary and inconsistent area, and
> requires understanding the interaction of the DB thread and the reactor
> thread.  (And at least part of this section would have to be dedicated
> to "and never, ever touch anything in this package aside from adbapi".)

I only ever use 'adbapi'.  The reason I say this is database functionality
is pretty darn important for all non-trivial programs, so programmers
to know about this functionality, wouldn't you agree?

> >d) Show how using "twistd" is really convient
> >(i.e. "twistd -ny server.tac" and "twistd -y server.tac", with some
> >logging
> >capability, etc)
> This, however, is a great suggestion.  Twisted plugins should be part of
> this discussion.

Thanks again for Twisted!


> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20080123/b7d263fb/attachment.htm 

More information about the Twisted-Python mailing list