Created
March 26, 2014 19:11
-
-
Save yuitest/9790953 to your computer and use it in GitHub Desktop.
標準入力を標準出力にそのまま返すだけ。ただし、 sleep 引数を取ってその分の秒数遅くして返す。デフォルトは 1
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
#!/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