3 ms·
Ask HN: How can I add shell pipeline support to my Python program?
Hi there!
I am currently working a program that allows you to fetch HTML data from a file/raw HTML document input, like this:
curl https://gohugo.io/ | soup '.title.text'
I have got the program to work as intended on its own, but now I am getting stuck at supporting the pipeline. Does anyone here have any advice or tips for implementing it?
All helps are appreciated!
- majormunky 4y agoI've not done this before, but, in a basic test I think this seemed to work import sys print(sys.stdin.read())
- memorable 4y agoJust tried it and it seems to work! Thanks for the answer!
- remram 4y agoThis seems like a StackOverflow question...
- memorable 4y agoYes, I know it's a SO question, but since I can't find it elsewhere, and I can't bother to go to StackOverflow and create a new account, so now I am asking.