Can select() be used with files in Python under Windows?

前端 未结 3 970
情话喂你
情话喂你 2020-12-06 07:07

I am trying to run the following python server under windows:

\"\"\"
An echo server that uses select to handle multiple clients at a time.
Entering any line          


        
3条回答
  •  情深已故
    2020-12-06 07:46

    I don't know if your code has other problems, but the error you're getting is because of passing input to select.select(), the problem is that it contains sys.stdin which is not a socket. Under Windows, select only works with sockets.

    As a side note, input is a python function, it's not a good idea to use it as a variable.

提交回复
热议问题