I have been writting a socket server in python. I want to send data to some users (no to all) but I dont know how to do it. Can i send it with a for loop?
For example:
some_clients = [client1, client2, client5, client9]
for client in some_clients:
client.send("data")
It is good?
If that works, it’s perfectly OK.
If you want something more readable, you could do:
or something like: