if len(exited_vehicles) == 0:
output = "-1"
else:
output = ":".join([str(e) for e in exited_vehicles])
conn.send(output)
// clear the list
After Change
// wait for a reply
data = None
while data is None:
data = conn.recv(2048)
// send the next vehicle
conn.send(str(exited_vehicles[0]))
del exited_vehicles[0]