cat.py 334 B

12345678910111213141516
  1. '''cat.py
  2. a version of unix cat, tweaked to show off runproc.py
  3. '''
  4. import sys
  5. data = sys.stdin.read(1)
  6. sys.stdout.write(data)
  7. sys.stdout.flush()
  8. while data:
  9. data = sys.stdin.read(1)
  10. sys.stdout.write(data)
  11. sys.stdout.flush()
  12. # Just here to have something to read from stderr.
  13. sys.stderr.write("Blah...")
  14. # end of cat.py