Skip to content

Instantly share code, notes, and snippets.

@mwicat
Created June 28, 2012 12:33
Show Gist options
  • Save mwicat/3011095 to your computer and use it in GitHub Desktop.
Save mwicat/3011095 to your computer and use it in GitHub Desktop.
wx with twisted reactor
import wx
class CustomerClientFactory(ClientFactory):
def __init__(self, app):
self.app = app
def buildProtocol(self, addr):
print 'Connected.'
return CustomerChatClient(self.app)
from twisted.internet import wxreactor
wxreactor.install()
from twisted.internet import reactor
wx_app = wx.PySimpleApp()
reactor.registerWxApp(wx_app)
reactor.connectTCP(host, port, EchoClientFactory(app))
reactor.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment