Skip to content

Instantly share code, notes, and snippets.

@sznurek
Created July 30, 2012 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sznurek/3205495 to your computer and use it in GitHub Desktop.
Save sznurek/3205495 to your computer and use it in GitHub Desktop.
Example
class SendText(IOBase):
def __init__(self, fd, text=b"Hello!"):
self.fd = fd
self.text = text
def register(self, fdmanager):
fdmanager.register_write(self.fs, self.write)
def write(self):
os.write(self.fd, self.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment