[Twisted-Python] reactor installation

Itamar Shtull-Trauring twisted at itamarst.org
Fri Oct 25 09:47:59 EDT 2002

On Fri, 25 Oct 2002 14:13:20 +0100
"John Kozak" <jk at xylema.org> wrote:

> I have a program which uses Qt and glues to Twisted via qtreactor.  As
> of 1.0.0 (ish - worked with most of the 0.99s), it no longer
> initialises, bleating that a reactor is already loaded.  The structure
> of this program is mildly eccentric: as part of my "explore UIs in
> Python" activity it was intended to have pluggable UIs in wx and Qt
> (actual experience of wx dissuaded me of this), and so it perhaps
> initialises the reactor rather later in the game than usual.  Is there
> a way I can take control over, or at least debug, reactor init?

Here's the rule - installing a reactor should always be the *first*
thing you do, and I do mean first. Importing other stuff before you
install the reactor can break your code.

wxPython support, as it does not install a new reactor, can be done at
any point, IIRC.

Itamar Shtull-Trauring    http://itamarst.org/
Available for Python, Twisted, Zope and Java consulting

More information about the Twisted-Python mailing list