Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #
- # by OuNiS 11.2023
- #
- # https://stackoverflow.com/questions/17658512/how-to-pipe-input-to-python-line-by-line-from-linux-program
- #
- # usage:
- # $ echo "TEST TEXT" | pipe_test.py
- #
- import sys
- # if len(sys.argv) > 1:
- # print(">> ", sys.argv[1])
- print("form Python script: ")
- for line in sys.stdin:
- sys.stdout.write(line)
- # or
- # print(line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement