Created
May 11, 2015 11:22
-
-
Save prologic/c0d6ca5d3d7fc421fef2 to your computer and use it in GitHub Desktop.
cat clone in circuits
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
import sys | |
from circuits.io import stdout, File, write | |
class Cat(File): | |
stdout = stdout | |
def read(self, data): | |
self.fire(write(data), stdout) | |
def eof(self): | |
raise SystemExit(0) | |
Cat(sys.argv[1]).run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment