Created
February 18, 2020 18:13
-
-
Save atucom/840e1723ebb42166492c9c5c98eab54e to your computer and use it in GitHub Desktop.
Holds onto stdin for specified number of seconds (or default 2) and then pipes to stdout.
This file contains 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 python3 | |
# takes stdin, sleeps, outputs to stdout | |
import sys | |
import time | |
def main(): | |
if len(sys.argv) > 1: | |
sleep_time = int(sys.argv[1]) | |
else: | |
sleep_time = 2 | |
time.sleep(sleep_time) | |
print(sys.stdin.read(), end="") | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment