I have a thread running that is looking for data from a socket connection. When it is empty it just sits there as I found it is supposed to, but I would like to pass by this when it is empty. I found that the select module should be able to do it, but now it just sits at the select line instead. I have tried this below from some research, but like I said, now instead of stopping at the data = sock.recv, it stops at the first line. Any ideas? Thanks.
while True:
readable, writable, exceptional = select.select([sock], [], [])
if readable:
data = sock.recv(1024)
else:
do something