30秒ごとにselect()をトリガーする関数をPythonで記述したいと思います。
これまでのところ、私のコードは次のようになっています-
inputs = [ UDPSock , sys.stdin]
outputs = []
while inputs:
readable, writable, exceptional = select.select(inputs, outputs, inputs)
for s in readable:
if s is UDPSock
# Deal with socket
elif s is sys.stdin:
# Deal with input
-の線に沿って何かを達成したい
inputs = [ UDPSock , sys.stdin, timer]
outputs = []
while inputs:
readable, writable, exceptional = select.select(inputs, outputs, inputs)
for s in readable:
if s is UDPSock
# Deal with socket
elif s is sys.stdin:
# Deal with input
elif s is timer:
# Deal with timer
理想的には、可能であればスレッドを使用せずにこれを実行したいと思います。