
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
.. contents:: Table of Contents :backlinks: none
selectz is distributed on PyPI_ as a universal wheel and is available on Linux/macOS and Windows and supports Python 2.7/3.5+ and PyPy.
.. code-block:: bash
$ pip install selectz
Modified Python 3 selectors example_ using selectz
.
.. code-block:: python
import selectz
import socket
sel = selectz.Selector()
def accept(sock):
conn, addr = sock.accept() # Should be ready
print('accepted', conn, 'from', addr)
conn.setblocking(False)
sel.register('read', conn, read)
def read(conn):
data = conn.recv(1000) # Should be ready
if data:
print('echoing', repr(data), 'to', conn)
conn.send(data) # Hope it won't block
else:
print('closing', conn)
sel.remove(conn)
conn.close()
sock = socket.socket()
sock.bind(('localhost', 1234))
sock.listen(100)
sock.setblocking(False)
sel.register('read', sock, accept)
while True:
sel.select()
selectz is distributed under the terms of both
at your option.
.. _PYPI: https://pypi.org .. _example: https://docs.python.org/3/library/selectors.html .. _MIT: https://choosealicense.com/licenses/mit .. _Apache: https://choosealicense.com/licenses/apache-2.0
FAQs
Select made easy
We found that selectz demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.