Created
July 30, 2012 07:24
-
-
Save sznurek/3205495 to your computer and use it in GitHub Desktop.
Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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