Skip to content

Instantly share code, notes, and snippets.

@yuitest
Created March 26, 2014 19:11
Show Gist options
  • Save yuitest/9790953 to your computer and use it in GitHub Desktop.
Save yuitest/9790953 to your computer and use it in GitHub Desktop.
標準入力を標準出力にそのまま返すだけ。ただし、 sleep 引数を取ってその分の秒数遅くして返す。デフォルトは 1
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals, print_function
if __name__ == '__main__':
import sys
import time
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('sleep', nargs='?', type=int, default=1)
sleep_time = parser.parse_args().sleep
for line in sys.stdin:
sys.stdout.write(line)
time.sleep(sleep_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment