[Twisted-Python] running code on its own and importing, howto install a different reactor?
Daniel Sank
sank.daniel at gmail.com
Fri Jul 29 12:27:54 MDT 2016
Looks like the problem is that the twisted.internet.reactor is imported
inside a block guarded by
if __name__ == '__main__'
When you import working_code that block doesn't run, because of the guard,
so terrific_method tries to access "reactor" which doesn't exist. I guess
your question is really how to get access to the reactor in
working_code.py, since you can't import it in the top level namespace
because you have ti install the qt5reactor *before* importing
twisted.internet.reactor (right?).
I don't know if there's a generally advised way of handling this, but I
would simply put all the stuff in the guarded block in its own file and
make sure to install the qt5reactor before importing anything else.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20160729/06286f9c/attachment-0002.html>
More information about the Twisted-Python
mailing list