June 16, 2024 at 6:20 pm
#160839
icare90
Participant
Hello Diego,
The full lecture is based on python2.
I didn’t manage to fix the code to make it work with python3.
Still this object type issue for the serialization.
Your help would be welcome.
And more generally speaking, a course updated for python3 would be a plus.
def reliable_send(self, data):
json_data = json.dumps(data).encode()
self.connection.send(json_data)
def reliable_receive(self):
json_data =””
while True:
try:
json_data = json_data + self.connection.recv(1024).decode()
return json.loads(json_data)
except ValueError:
continue
def execute_remotely(self, command):
self.reliable_send(command)
return self.reliable_receive()