Guest User

Untitled

a guest
Jan 12th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. import sys
  2.  
  3. def pipe(func):
  4.     while True:
  5.         val = yield
  6.         func(val)
  7.  
  8.  
  9. x = pipe(sys.stdout.write)
  10.  
  11. x.next()
  12.  
  13. x.send("Hello, World!\n")
  14. x.send("This is fucking weird!\n")
Add Comment
Please, Sign In to add comment