I'm trying to collect data which is being parsed via a socket. Here is my code:
import pickle
import SocketServer
class SocketReciever(SocketServer.BaseRequestHandler):
def handle(self):
sint = self.request.makefile('rb')
objectt = pickle.load(sint)
#print(objectt)
ParentClassCall(objectt)
if __name__ == "__main__":
HOST, PORT = "localhost", 60
# Create the server, binding to localhost on port 9999
server = SocketServer.TCPServer((HOST, PORT), SocketReciever)
# Activate the server; this will keep running until you
# interrupt the program with Ctrl-C
server.serve_forever()
data=[]
def ParentClassCall(currentdata):
data.append(currentdata)
My question is how would I call the ParentClassCall function from within the SocketReciever class?
I know this method is plagued with security problems but it will be run on a computer without internet access.