1 ~ 3 個の引数がシーケンスである必要があるというこのエラーを受け取り続けます
import socket # Import socket module
import sys
import select
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Create a socket object
host = "127.0.0.1" # Get local machine name
port = 50001 # Reserve a port for your service.
s.bind((host, port)) # Bind to the port
a = []
b = []
s.listen(1) # Now wait for client connection.
c, addr = s.accept() # Establish connection with client.
s.setblocking(0)
ready = select.select(s, s, s, 1) # i believe the error lies in here
while True:
print "reached"
if ready[0]:
print "reached1"
data = mysocket.recv(4096)
print 'Got connection from', addr
c.send('Thank you for connecting \r\n') #all strings have to end with /r/n!!!
print "sent"
c.close() # Close the connection
エラー
Select.select 引数 1 - 3 はシーケンスでなければなりません。
私はpythonが初めてなので、エラーが何であるかわかりません。recvソケットをブロックしないようにしたかったので、別の投稿から選択コードをグーグルで検索しました