I am using settimeout()
function in such way:
import socket
s.connect((host,port))
s.settimeout(1) #a
try:
while True:
s.settimeout(0.030) #b
try:
code
except socket.timeout:
code
break
except socket.timeout:
print('over')
my code is in this form. Now timeout at a is not working but timeout at b is working because the code in timeout at b is executing
My project is to run further program for almost 1 sec but it is moving in continuous loop. I know it is because of while True but the code under loop should run continuously for 1 sec
If anyone have another method or tricks are heartily welcome