문제

Okay, so, I just have a quick question regarding python and linux.

I have a program that collects and outputs data to stdout indefinitely. I need to parse this data, and I have a python program I wrote that will do just that. However, I cannot save this data to a file first, as it produces far too much output to save to disk. Is there any way to use redirects to somehow pipe this output into the program?

Example:

python parser.py < ./dataCollector.sh
도움이 되었습니까?

해결책

Close, but you want an actual pipe not a shell redirect:

./dataCollector.sh | python parser.py
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top