{"library":"selectors2","title":"selectors2","description":"Back-ported, durable, and portable selectors module for Python. Current version 2.0.2. Maintained but stable; rarely updated.","language":"python","status":"maintenance","last_verified":"Fri May 01","install":{"commands":["pip install selectors2"],"cli":null},"imports":["from selectors2 import DefaultSelector"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import selectors2\nimport socket\n\nsel = selectors2.DefaultSelector()\nsock = socket.socket()\nsock.bind(('localhost', 1234))\nsock.listen()\nsel.register(sock, selectors2.EVENT_READ)\nwhile True:\n    events = sel.select(timeout=1)\n    for key, mask in events:\n        conn, addr = key.fileobj.accept()\n        print(f'Connection from {addr}')","lang":"python","description":"Create a DefaultSelector and register a listening socket for read events.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}