[Twisted-Python] Problems using win32eventreactor()

Dave Peticolas dave at krondo.com
Mon Feb 10 21:04:56 EST 2003


On Mon, 2003-02-10 at 18:01, Jeff Grimmett wrote:
> Hi,
> 
> I'm having a problem using the win32eventreactor, following the example
> code. Here's the basic gist of the code in use:
> 
> from	twisted.internet.protocol	import	Factory
> from	twisted.internet		import	reactor
> from	twisted.internet		import	win32eventreactor
> from	twisted.protocols.basic	import	LineReceiver
> 
> 
> :: classes and stuff ::
> 
> win32eventreactor.install()
> 
> factory = myFactory()
> reactor.listenTCP(1001,factory)
> reactor.run()
> sys.exit(0)
> 
> This generates an error message at the win32eventreactor.install() line:
> 
>     assert not sys.modules.has_key('twisted.internet.reactor'), \
> AssertionError: reactor already installed
> 
> What am I missing?

Try importing the win32 reactor first and then immediately
installing it:

from	twisted.internet		import	win32eventreactor
win32eventreactor.install()

from	twisted.internet		import	reactor


dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030210/db62c784/attachment.pgp 


More information about the Twisted-Python mailing list