Created
June 28, 2012 12:33
-
-
Save mwicat/3011095 to your computer and use it in GitHub Desktop.
wx with twisted reactor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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