def send(self, data):
    if (self.sock is None):
        self.makeSocket()
        if (self.sock is None):
            return ''
    if (self.pythonVersion == 3):
        self.sock.sendall((str(data) + '\n').encode('UTF-8'))
    else:
        self.sock.sendall((data.decode('UTF-8') + '\n').encode('UTF-8'))
    totalData = []
    while 1:
        try:
            data = self.sock.recv(4096)
            if ((not data) or (len(data) == 0)):
                break
            totalData.append(data.decode('UTF-8'))
            time.sleep(0.01)
        except:
            if totalData:
                break
    self.sock.close()
    self.sock = None
    return ''.join(totalData)
def send(self, data):
    if (self.sock is None):
        self.makeSocket()
        if (self.sock is None):
            return 
    if (self.pythonVersion == 3):
        self.sock.sendall((str(data) + '\n').encode('UTF-8'))
    else:
        self.sock.sendall((data.decode('UTF-8') + '\n').encode('UTF-8'))
    totalData = []
    while 1:
        try:
            data = self.sock.recv(4096)
            if ((not data) or (len(data) == 0)):
                break
            totalData.append(data.decode('UTF-8'))
            time.sleep(0.01)
        except:
            if totalData:
                break
    self.sock.close()
    self.sock = None
    return .join(totalData)