Proper way to add functionality to handle() in a python TCP Server?
<p>I have code like this:</p>

<pre><code>class SingleTCPHandler(SocketServer.BaseRequestHandler):
    """ One instance per connection. """
    def handle(self):
        data = Net.recv_from_socket(self.request)
        GUI.run(str("RECV'd message: %s" % data))

class SimpleServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
    def __init__(self, server_address, RequestHandlerClass):
        SocketServer.TCPServer.__init__(self, server_address, RequestHandlerClass)
</code></pre>

<p>But I don't want to have to use <code>GUI</code>, a global variable, to contain the function that I want to call when a message is received by my server. Instead I want to send the <code>SingleTCPHandler</code> class the <code>GUI</code> object so it can call the function locally instead of referencing a global variable.</p>

<p>Thoughts? Little new to python...</p>
